Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: split question

by chipmunk (Parson)
on Sep 08, 2001 at 18:36 UTC ( #111161=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $inLine = "RPC, rpc #001b, (1987)";
    my $year;
    if ($inLine =~ /\((\d+)\)/) {
    ...
      die "No year found in '$inLine'.\n";
    }
    print "Found year '$year' in '$inLine'.\n";
    
  2. or download this
    my $inLine = "RPC, rpc #001b, 1987";
    
    $inLine =~ /(#\d+[a-z])/;
    ...
    $inLine =~ /\((\d+)\)/;
    my $year = $1;
    print "Found year '$year' in '$inLine'.\n";
    
  3. or download this
    Found rpc num #001b in RPC, rpc #001b, 1987.
    Found year #001b in RPC, rpc #001b, 1987.
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-09-17 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (60 votes), past polls