c# - Block regex to recognize number while it's part of a URL -
i using regex: [(]?(((\d)([() .-]+)?)+){7,18}|\*\d{3,10}|\d{3,10}\*(?!/)
how can change attached regex not recognize numbers part of url facebook phone number, recognize phone number not part of url?
the url: https://www.facebook.com/pages/fashion-24/151055822249094?fr=ts
the above regex detect "151055822249094" phone number.
you can use negative lookbehind in regex:
(?<!/)[(]?(((\d)([() .-]+)?)+){7,18}|*\d{3,10}|\d{3,10}*(?!/)
Comments
Post a Comment