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

Re^2: regular expressions query

by qq (Hermit)
on Jun 30, 2004 at 23:24 UTC ( [id://370940]=note: print w/replies, xml ) Need Help??


in reply to Re: regular expressions query
in thread regular expressions query

Post your code and a couple of lines of data. The examples given _do_ work. Perhaps we are missing a part of the problem?

#!/usr/bin/perl while ( <DATA>) { ($a,$b) = split ' '; print "split '$a','$b'\n"; my ($a,$b) = $_ =~ /(\S+)\s+(\S+)/; print "match '$a','$b'\n"; } __DATA__ none bing some bong any bang

output:

split 'none','bing' match 'none','bing' split 'some','bong' match 'some','bong' split 'any','bang' match 'any','bang'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-03-19 07:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found