in reply to Re^2: regex
in thread How do I detect if a number has a minus sign?
There are any number of ways you can identify/validate conditions on your term. (duff's reference has several). The idea is to peel off the parts of your test value that you need into seperate variables and then check the conditions individually. I have found that trying to find some super regex that does it all isn't worth the effort (although it can be aesthetically pleasing)if($sign eq '-'){ do something ... } if(not $den){ do something .... } # $den will be undefined if no denom +inator is found if(length($num_ == 3){ do something ... }
|
---|