in reply to regex end of line
You just want to say: if ($newLine =~ /\w$/) { ... }. That checks to see if $newLine ends in a word character. Maybe you even want /\w{2}$/ instead, to ensure at least two word characters.if ( ($newLine =~ /$/)[0] # always true, returns 1 eq /(\w+)$/ # returns 1 if $_ ends in word, "" if not ) { ... }
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
|
|---|