Wrong. This will give you an array of substrings that were matched by the pattern. The requirement is to get the lines that match the pattern.
You could change it to
@patternMatchArray = $lines =~ /^.*pattern.*$/mg;But it doesn't seem like a good solution to me, though I can't put my finger on exactly why not...
In reply to Re: Re: matching lines in multi-line string
by edan
in thread matching lines in multi-line string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |