in reply to Regex and a pseudo-XML tag

For robustness, you should probably look into Text::Balanced. For quick and dirty, which means putting more limits on what you will accept (no nesting or line breaks, for example), this might get you there:
m/<blank\s+title\s*=\s*(["'])?(.*?)$1\s*>/
Update: As noted in the reply below, the $1 should be a \1.

Replies are listed 'Best First'.
Re: Re: Regex and a pseudo-XML tag
by graff (Chancellor) on Nov 21, 2003 at 03:28 UTC
    In order use a captured string as part of a regex match, you need to use a backslash in front of the digit, not a dollar sign:
    m/<blank\s+title\s*=\s*(["'])?(.*?)\1\s*>/ --
    To show a simpler example, consider:
    $_ = "here are ::framed words:: to capture"; if ( /(::)(.*?)\1/ ) { print "text framed by $1 was <$2>\n"; }
    If you try it with $ instead of \, it doesn't work.