Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: String parsing

by ysth (Canon)
on Jan 05, 2004 at 12:10 UTC ( #318823=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $tempstr = $str;
    # get rid of () around status
    $tempstr =~ s/^([^(:]+)\(([^)]+)\)/$1$2/;
    # grab the status and anything in parentheses
    @needed = $tempstr =~ /(^[^:]+|(?<=\()[^)]+(?=\)))/g;
    
  2. or download this
    @needed = $_ =~ /(^[^:]+|(?<=\()[^)]+(?=\)))/g;
    $needed[0] =~ y/()//d;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2018-10-15 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (82 votes). Check out past polls.

    Notices?