Steve Massey wrote: > > using the following code.. I am looking to match any text that has a date in > it ie 8-Nov, nut my code also matches 8-11b, which is not what I want > > help appreciated > > Steve > > > ======== > #! /usr/bin/perl -w > > $test = "8-11b1"; > ##$test = "8-Nov1"; > > if ( $test =~ /(\d{1,2})\-(\w{3})([\d\w]*)/) { > $day = $1; > $month = $2; > $rem = $3; > print "result is $day..$month..$rem\n"; > } else { > > print "result is $test\n"; > }
Hi Steve. This should do the trick: if ( $test =~ /(\d+)-([a-z]+)(.*)/i ) { : } HTH, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]