0

My URL's might not be well formatted, so it could be http://www.google.com/ or www.google.com or google.com and it'll be in a block of text like:

This is google.com and it rocks!

I need to find the website and replace it with [*********]

Any ideas?

Shamoon
  • 41,293
  • 91
  • 306
  • 570

2 Answers2

1

This might be useful: http://snipplr.com/view/2371/regex-regular-expression-to-match-a-url/ also this question: PHP validation/regex for URL

Community
  • 1
  • 1
rojoca
  • 11,040
  • 4
  • 45
  • 46
1

Have a look at this question: Regex to match URL

Community
  • 1
  • 1
M4N
  • 94,805
  • 45
  • 217
  • 260