Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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.


Comment on Re: Find Number in String then Ignore Characters proceeding
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://973132]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (13)
As of 2015-07-29 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls