in reply to Getting element of array with a match

Your problem description wasn't very clear, and it kind of looks like an XY Problem actually, why are you trying to do that? Are you sure there's not a better way to achieve your goal?.

Anyway, it looks like you're asking for tr///, tr/a-zA-Z//cd; will remove any non-alphabetic char from your string, tr/a-zA-Z//cdr; will return a new string equal to the first without the non-alphabetic chars.