in reply to Pattern for a single word
G'day Nansh,
You don't need to fire up the regex engine for that. Take a look at substr and rindex: you'll also find they're a lot faster.
$ perl -E 'say substr $_, 1 + rindex $_, "_" for qw{He_is_super_hero_S +piderman He_was_a_super_actor_Tom}' Spiderman Tom
— Ken
|
|---|