K
KaZ
Hello,
I'm trying to find all elements of an array that match a particular
pattern. So far, I used:
grep { /\t$var\t/ } @array
but it doesn't match. I have the impression, it tries to match only the
element of the array which are *exactly* matching. But I want a match
anywhere in any element of the array.
Here:
http://perldoc.perl.org/functions/grep.html
there is a "!" before the "/". What does this means? I didn't find
anything about this...
I also tried /.*\t$var\t.*/ but it doesn't match either...
Greetings,
I'm trying to find all elements of an array that match a particular
pattern. So far, I used:
grep { /\t$var\t/ } @array
but it doesn't match. I have the impression, it tries to match only the
element of the array which are *exactly* matching. But I want a match
anywhere in any element of the array.
Here:
http://perldoc.perl.org/functions/grep.html
there is a "!" before the "/". What does this means? I didn't find
anything about this...
I also tried /.*\t$var\t.*/ but it doesn't match either...
Greetings,