I am trying to create a regex conditional match. A portion of the regex match should be reused to further match against the string. The following example:
"sometext http://www.somedomain.com/test.html somemoretext http://www.someotherdomain/www/hello/more.html someothertext"
I would like to match on the domain portion of the url http://www.somedomain.com and determine whether the following urls originate from the same domain. if not, I would like a match to occur. So:
"sometext http://www.somedomain.com/test.html somemoretext http://www.someotherdomain/www/hello/more.html someothertext" <- this is a match
"sometext http://www.somedomain.com/test.html somemoretext http://www.somedomain.com/www/hello/more.html someothertext" <- this is not a match
Any regex gurus that know the answer to this one out there?
2006-08-27
23:51:39
·
2 answers
·
asked by
christian
1
in
Computers & Internet
➔ Programming & Design