Re: return something

2012-11-21 Thread timothy adigun
Hi shawn, On Wed, Nov 21, 2012 at 11:48 PM, shawn wilson wrote: > how do i return something when i've got a long regex and one of the > captures is empty? > > $_ = '"435" "" "634"; > my ($one, $two, $three)= /^ >"(\d+)"\ >"(\d+)"\ >"(\d+)" > /x; > You can do like so: $_ = '"435

Re: return something

2012-11-21 Thread Shawn H Corey
On Wed, 21 Nov 2012 17:48:00 -0500 shawn wilson wrote: > how do i return something when i've got a long regex and one of the > captures is empty? > > $_ = '"435" "" "634"; > my ($one, $two, $three)= /^ >"(\d+)"\ >"(\d+)"\ >"(\d+)" > /x; > First, this contains a syntax error. Please

Re: return something

2012-11-21 Thread Danny Gratzer
Instead of + use *. * means 0 or more while + means 1 or more On Nov 21, 2012 4:51 PM, "shawn wilson" wrote: > how do i return something when i've got a long regex and one of the > captures is empty? > > $_ = '"435" "" "634"; > my ($one, $two, $three)= /^ >"(\d+)"\ >"(\d+)"\ >"(\d+)"