Page 1 of 1

RegExp trouble

Posted: Wed Nov 12, 2008 4:00 am
by fabio.casolari
I have to math an URL in an href link that can have single or double quote or not.

With this example

/href=(\"|\')(http:\/\/www\.my\.url|)/

the only match i have are:

href="http://www.my.url
and
href='http://www.my.url

but not

href=http://www.my.url

how i can make a regexp that match this type of code?


Thank you all...

Re: RegExp trouble

Posted: Wed Nov 12, 2008 4:05 am
by VladSun

Code: Select all

/href=("|')?(http:\/\/www\.my\.url|)/

Re: RegExp trouble

Posted: Wed Nov 12, 2008 4:47 am
by fabio.casolari
It works! Thank you very much!