0

I need to Detect the any Url(with or without http,https,www...) in the text by regex on c# In any case, I want to Detect the domain name or url

Please help me

Sample :

google.com
http://google.com
http://www.gooogle.com
gooogle . com

sample regex :

(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]"

([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?

The above code examples can't detect gooogle . com

Dharman
  • 30,962
  • 25
  • 85
  • 135

1 Answers1

0

How about this one:

(http\:\/\/)*w*\.*go+gle\s*.\s*com

https://regex101.com/r/782DNM/1

eugen
  • 1,249
  • 9
  • 15
  • thanks for your help your regex just detect google.com, google is my sample my users have own domain and i dont want use own domain in content so i need detect domain or url – Mohammadreza Parash Mar 20 '20 at 06:25