But then that rules out '-7.', which the OP explicitly wants to include.
You could try this (leaving out the non-capturing ?:s for clarity):
print "match" if $str =~ /-\d*((?<=\d)\.)|(\.(?=\d))/;but then that would match if:
my $str = 'See answers on pages 234-235.'oh well...
dave
In reply to Re: Re: Regex negative number question
by Not_a_Number
in thread Regex negative number question
by Lori713
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |