tags:

views:

57

answers:

2

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?

+1  A: 

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

rojoca
+1  A: 

Have a look at this question: Regex to match URL

M4N