Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Find Number in String then Ignore Characters proceeding

by temporal (Pilgrim)
on May 29, 2012 at 21:33 UTC ( #973132=note: print w/replies, xml ) Need Help??


in reply to Find Number in String then Ignore Characters proceeding

A little more legible (if not as elegant) version of what the previous post is doing:
#! perl my $str = '.,a..A,,C..+4ACGTG.,-2TG,,...,a.'; print replace($str); sub replace { my $str = shift; if ($str =~ m/([+-])(\d*)/) { $str =~ s/\Q$1\E$2.{$2}//; return replace($str); } return $str; }

Strange things are afoot at the Circle-K.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://973132]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2016-12-03 11:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (55 votes). Check out past polls.