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'