I would like to grep @array for an exact match of $search, if I domy $search = "foo"; my @array = ("s1 bar", "s2 notfoo", "s3 foo")
grep will match both the 2nd and 3rd elements of @array as they both end in "foo", is it possible to only return an exact match for the last characters the same size of the search term? Cheers, Chrisgrep {/$search$/} @array
In reply to grep regex exact match last n positions by coldy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |