This problem might not be a specific programming issue but, I try to find chemical formulas like H20, C02 etc. in a scientic text and I use this:
(?<=[\l\u]|\.)\d+
This works - but now also every floating point number after the 'dot' is found:
0.1234 -> 1234 is selected.
Is there a chance to prevent this? Thanks in advance!
You might also include a negative lookbehind to prevent a preceding dot with a digit before it:
(?<=[\l\u.])(?<!\d\.)\d+