I am facing a problem to match and replace certain words, not contained in http://
Present Regex:
http://.*?\s+
This matches the pattern http://www.egg1.com http://www.egg2.com
I need a regex to match certain words contained outside the http://
Example:
"This is a sample. http://www.egg1.com and http://egg2.com. This regex will only match
this egg1 and egg2 and not the others contained inside http:// "
Match: egg1 egg2
Replaced: replaced1 replaced2
Final Output :
"This is a sample. http://www.egg1.com and http://egg2.com. This regex will only
match this replaced1 and replaced2 and not the others contained inside http:// "
QUESTION: Need to match certain patterns (as in example : egg1 egg2) unless they are part of http:// .Do not match egg1 and egg2 if they are present within http://
http://foo.co.uk
” you want theco
? – Beedonhttp://www.google.com
", skipping the "google" within the URL. – Meridethmeridian