using the following strings
9989S90K72MF-1 9989S90S-1 9989S75K60MF-1 9989S75S-1
I Would like to extract the below from those strings.
9989S90 9989S90 9989S75 9989S75
So far I have:
(^.*?(?=K|-))
Which gives me:
9989S90 9989S90S 9989S75 9989S75S
Here's a link https://regex101.com/r/d1nQj0/1
I've tried a few different regex but can't seem to nail it. Is there a way to ignore the first occurrence of a digit/letter? Which in my case would be S
S
The following regex matches a string at the beginning of a line that contains a single S up to but not including the first occurrence of S or K
^(.*?S.*?)(?=K|S)
2.1m questions
2.1m answers
60 comments
57.0k users