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

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -