I am trying to modify the following regular expression, which is for integers either negative or positive.
$_[0] =~ /^(?:|-|\d+|-\d+)$/
I'd like the regular expression to also capture floating point values either negative or positive. I thought this would work but it is not.
$_[0] =~ /^(?:|-|\d+|-\d+|\d+\.\d+|-\d+\.\d+)$/
In reply to Floating Point/Integer Regular Expression by shortyfw06
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |