I'm trying to create statements where I can use .* with conditions (no consequtive two letters for example), and I've been failing for a while. Starting here:
"SOMETEXT 1-7, 39-41, 12B, 1-7, SOME OTHER TEXT, SOME MORE OTHER TEXT"
I want to find:
"SOMETEXT 1-7, 39-41, 12B, 1-7,"
I've made it to the point where I can look for text followed by a number and any comma:
^[A-Z]+[A-Z] [1-9].*,
using the regular expression builder here: https://regex101.com/r/yK6oF4/1
but here I still get:
"SOMETEXT 1-7, 39-41, 12B, 1-7, SOME OTHER TEXT,"
how can I tell .* to stop when it finds two consequtive letters? Or a comma, a space, and a letter? Any condition like that. I want to look only for numbers (including "numbers" such as 12B) and punctuations after what I've found before the .*.
I use R but I think this question is general about regular expressions.