My code reads a line from a file and replaces numbers of length 3 to 18 digits.
The thing is I don't want to match numbers that follow the string DOM: (white space after colon).
For example:
match: tttt 23456789 dkdkd
match: 6783456789 dkdkd DOM:
no match: DOM: 23456789 dkdkd
no match: dhdhd DOM: 23456789 dkdkd
no match: DOM: 2789 dkdkd DOM: 34567896
I have tried using negative look-ahead: .*(?!DOM: )[0-9]{3,18}
But it doesn't work, please help.