in reply to regular expression

 '([^']+)'

Replies are listed 'Best First'.
Re^2: regular expression (blah blah blah)
by ansh batra (Friar) on Jan 07, 2013 at 09:34 UTC

    it is fetching the whole img tag
    i need only value of src attribute

      Most likely what Anonymous Monk showed you was not supposed to be the complete regular expression but intended to be used for matching the src attribute only. You will have to apply that hint appropriately.

      Did you try to understand my regex pattern? YAPE::Regex::Explain? Put it in your regex, match up the quotes, delete your stuff, use my stuff
        Although your suggestion makes the REGEX better, the primary problem is that $& contains the entire match, not the first subpattern ($1).