I am trying to capture 8 digit phone numbers in free text. This should be ignored if a particular string appears before.
My regex:
(\b(\+?001|002)?[-]?\d{4}(-|\s)?\d{4}\b)
To Capture:
+001 12345678
12345678
Not Capture:
TTT-12345678-123
TTT-12345678
I am trying to use negative look behind as below example:
\w*(?<!foo)bar
But the above works only if the regex doesn't have subsequent groups.