10-19-2015 03:15 AM
Hi,
I have a simple but complicated question on regular expression using star(*) and (+).
When I wanted to detect a floating number, I used [-+]?[0-9]+\.?[0-9]+ but found [-+]?[0-9]*\.?[0-9]+ is more popular in expert people.
In this expression, * was used in the decimal part but + used in the floating part.
In definition, * can exclude a character itself but + need to get the number definitely.
Can you give me wrong example for "[-+]?[0-9]+\.?[0-9]+" which can detect a number rightly by "[-+]?[0-9]*\.?[0-9]+ " ?
labmaster.
Solved! Go to Solution.
10-19-2015 06:32 AM
.14 will be detected by the 2nd but not the first.
I'd probably use * on the fractional part also.
/Y
10-19-2015 07:07 AM