Perl: the Markov chain saw | |
PerlMonks |
Re: Find Number in String then Ignore Characters proceedingby Eliya (Vicar) |
on May 29, 2012 at 21:05 UTC ( [id://973123]=note: print w/replies, xml ) | Need Help?? |
(Unfortunately, the straightforward attempt $str =~ s/[+-](\d+).{\1}//g; doesn't work.) See (??{ code }). Upd: changed (??{"\\w{$1}"}) to (??{".{$1}"}), just in case you need to remove any character, not just alphanumeric.
In Section
Seekers of Perl Wisdom
|
|