0

Possible Duplicates:
Regex to match URL
What is the best regular expression to check if a string is a valid URL

I want to catch urls in strings if any. What is the best regex for this? Urls may or not be abolute.

http://www.blabla.com

http://blabla.com

www.blabla.com

all should match.

Thank you.

\b(https?)://[-A-Z0-9+&@#/%?=~|!:,.;]*[-A-Z0-9+&@#/%=~|]. this regex is enough to some degree but no match for www.blabla.com , so how can i edit to catch the latter either?

Community
  • 1
  • 1
wonnie
  • 449
  • 3
  • 6
  • 18
  • 1
    Duplicate: http://stackoverflow.com/questions/161738/what-is-the-best-regular-expression-to-check-if-a-string-is-a-valid-url – Bogdan Constantinescu Apr 04 '11 at 09:52
  • Yeah, that (\b(https?)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|].) was good but no match for www.blabla.com. Help please. Thanks. – wonnie Apr 04 '11 at 10:28

0 Answers0