Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Calling all REGEX Gurus - nasty problem involving regular expressions combined with hash keys - I need ideas as to how to even approach the problem

by davido (Cardinal)
on Feb 08, 2013 at 22:50 UTC ( [id://1017897]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %xref = ( 
        'abbrev1' => '100 - Non-Abbreviated 1',
        'abbrev2' => '200 - Non-Abbreviated 2',
        ...
    );
    
  2. or download this
    my $alternations = join '|', keys %xref;
    my $regexp = qr/\b($alternations)\b/;
    
  3. or download this
    my( $abbrev ) = $raw_response =~ m/$regexp/;
    my $std_response;
    ...
        die "No valid response found in <<$std_response>>";
    }
    print "$std_response\n";
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-26 01:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found