in reply to Matching optionally quoted string

next unless m{<REF HREF=\"?([^"]*)\"?\s*/>};
ought to work. Two key differences: dissallowing quotes in the (.*), and allowing for whitespace between the close quote and the close of the xml tag.

Of course, all the standard caveats about trying to parse XML (or HTML, etc) with regular expressions apply. That is, it may work here, but don't expect it to always work... and you've really got to be a god with regexps to do it very well, to begin with.


------------
:Wq Not an editor command: Wq