Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 pondering the Monastery: (5)
As of 2014-12-27 14:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls