I think you can also do this kind of work with Text::Balanced or Regexp::Common::delimited.
In reply to Re: quote regular expression by kyle in thread quote regular expression by sadfaceman