Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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?
erix .o.O ( I reckon yet again some pieces broke off UK are added to NL downstream... )
erix joining the EU after all

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2017-10-17 10:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (225 votes). Check out past polls.

    Notices?