Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: Regular Expression problem with $variable =~ m/C++/by ikegami (Patriarch) |
on Jun 12, 2007 at 16:35 UTC ( [id://620758]=note: print w/replies, xml ) | Need Help?? |
You might find the following useful:
@matches will contain the indexes (0, 1, 2 and/or 3) or the elements of @Array that contains the matching substrings. The commas ensure C won't match VISUAL BASIC, and the i ensures Perl will match PERL. If the same item won't appear in two array elements, then you can use the following version to store the index in $match:
In Section
Seekers of Perl Wisdom
|
|