I'm new to Stackoverflow and regex, so please bear with me. I have an individual posting false phone numbers on our forum. The forum has a content filter that uses regular expressions, and a colleague updated the filter before going on paternity leave. Now I need to update the expression to account for new patterns. If it matches the phone number is replaced with [Redacted]. Is it possible to write an expression that matches the numbers below, but excludes our support line? (The support line number can stick to a single format)
- 1(864) yuppie 361-8969
- 1(868) yuppie 751 1556
- 1(878) 761-1655
- 1(864) 391-8999
- 1(865) 446 4830
Support Line 1-866-9789
So I really have two questions, 1) Can I use a negative look ahead to match all phone numbers and formats except for our support line? 2) Can I match phone numbers when text is entered in-between the numbers?
The tricky part is I can't ban all numbers or combinations because the forum is used to discuss finances. So numbers are used in posts on a regular basis.
Thanks in advance!