in reply to Re: grep regex exact match last n positions
in thread grep regex exact match last n positions

That's an expensive way of doing substr! Not to mention that your regexp actually doesn't find the last 3 characters - it finds the first 3 characters following the last word boundary.
print grep {substr($_, -length($search)) eq $search} @array;