Title: Problematic Matches: Matches Decimal Point/Sign
Date: 4/27/2009 10:06:50 PM
This regular expression can match a decimal point alone, a negative sign alone, and a positive sign alone. This will obviously result in an error in many languages during conversion. Please use the regular expression provided by Darren Neimke below.
Title: how to write Regular Expression for empty strings and only -ve decimal
Name: how to write Regular Expression for empty strings and only -ve decimal
Date: 3/20/2009 1:29:13 PM
how to write parter for empty strings and only -ve decimal
if i remove + then also it verify +ve values.
Title: Empty Strings
Name: Darren Neimke
Date: 8/12/2003 4:17:08 PM
As mentioned, this pattern also matches empty strings. To ensure that a number is present use alternation like so:
This is basically saying:
- Match from the beginning of the input
- Match an OPTIONAL +/- sign
- Match either any amount of numbers followed by OPTIONAL trailing decimal point and numbers OR OPTIONAL numbers followed by COMPULSORY decimal point and numbers.