How do I write a regexp that will select 1.23 or -12.34 but not 1.2.3?
$a =~ s/(\-*\d+\.\d+)/foo\1bar/g;
This always selects 1.2 out of 1.2.3, and it should not. I.e., "foo1.2bar. 3" is an error.
Thanks!
$a =~ s/(\-*\d+\.\d+)/foo\1bar/g;
This always selects 1.2 out of 1.2.3, and it should not. I.e., "foo1.2bar. 3" is an error.
Thanks!
Comment