my $term = "\"foo\"[MH] OR \"bar\"[MH]"; my @matches = ( $term =~ /\"(.+)?\"\[MH\]/ );
As a side note you don't have to do double-quotes-quoting-acrobatics: just use single quotes or alternate delimiters (should you need interpolation or "\*" thingies).
my $term = '"foo"[MH] OR "bar"[MH]';
or
my $term = qq|"foo"[MH] OR "bar"[MH]|;
In reply to Re: regex help
by blazar
in thread regex help
by rsiedl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |