Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Match url string and surround with quotes??

Last post 07-07-2008, 1:49 PM by ddrudik. 3 replies.
Sort Posts: Previous Next
  •  07-07-2008, 10:24 AM 43815

    Match url string and surround with quotes??

    Hello,

    I'm having trouble doing this and would like some advice if possible. 

    I want to match this: href=http://abc.def.com/xyz_p/qwerty/789_098

    and replace it with this:  href="http://abc.def.com/xyz_p/qwerty/789_098"

    That is, put quotes around the url part. The url here is just an example so actually it will always be different.

    Any help appreciated!!

     

    Thanks in advance. 

  •  07-07-2008, 10:33 AM 43817 in reply to 43815

    Re: Match url string and surround with quotes??

    Raw Match Pattern:
    href=((?!['"])[^ >]*)

    Raw Replace Pattern:
    href="$1"


  •  07-07-2008, 1:01 PM 43822 in reply to 43817

    Re: Match url string and surround with quotes??

    Perfect!

    Thanks!

  •  07-07-2008, 1:49 PM 43824 in reply to 43822

    Re: Match url string and surround with quotes??

    Glad I could help.


View as RSS news feed in XML