in reply to getting the tail of a string
The correct solution in this case is using basename, since it is a filepath problem. More generally, it's a split() problem. Only most generally is regexp appropriate. Even then, I would avoid POSTMATCH - while the expense is tolerable, it's still high. Better to actually match the string you want, and remember that.
$x =~ m|(?:[^/]/)*/(.*)}; print $1;
--
TTTATCGGTCGTTATATAGATGTTTGCA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re:x2 getting the tail of a string (substr and rindex)
by grinder (Bishop) on Jun 10, 2003 at 17:11 UTC |