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

Image tag regex help

Last post 10-10-2008, 11:03 AM by Jagarm. 2 replies.
Sort Posts: Previous Next
  •  10-08-2008, 12:57 PM 47015

    Image tag regex help

    I have the following regex: <img([^>]*)[^/]>

    It captures images tags like this: <img src="#" > that is without />

    The problem is if the image tag is as follows <img src="#"> that means there is no space between " and > it doesn't include the last single quote after # it captures like this

    src="#

     

    Any way to include the last quote even though there is a tag or not after " 

     

    Thanks

     

    Jagar,

  •  10-08-2008, 1:58 PM 47019 in reply to 47015

    Re: Image tag regex help

    You should move the closing parenthesis of your capturing group to the right.
  •  10-10-2008, 11:03 AM 47073 in reply to 47019

    Re: Image tag regex help

    Thanks a lot, that works perfect!
View as RSS news feed in XML