Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

One regex construct to handle multiple string types

by neversaint (Deacon)
on Nov 29, 2008 at 07:21 UTC ( #726738=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $str1 = "2L";       # want to capture 2L
    my $str2 = "bar.2L"; #want to capture 2L
    
  2. or download this
    while(<DATA>) {
        /\w*\.*(\S+)/; 
    ...
    __DATA__
    2L
    bar.2L
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2022-08-17 01:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?