Reputation: 4163
I am trying to match a comma surrounded by alpha characters with no space leading or trailing but to ignore if they are surrounded by numerals such as the thousands separator in a large number.
Below is what I have so far but the problem is that the Full Match returns the comma with the first character. ,v
in this example. However I just need the comma to be returned as the full match.
I have tried (,)(?:[^\d\s])
and also (,)(?:[^\d\s])\K
but with the \K
the full match is empty.
I want to match the first and third line from this example but ignore the second and fourth:
uncased,vertical
80,000 btu
80,000,vertical
80,000, vertical
https://regex101.com/r/YH0Vd0/1
Upvotes: 0
Views: 126
Reputation: 4523
The following regex ( using positive look-ahead ) should do it :
,(?=[^\d\s])
Upvotes: 1