Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2022-09-30 10:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (126 votes). Check out past polls.

    Notices?