Andrzej Lach

Greenhorn
+ Follow
since Jul 10, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Andrzej Lach

Of course I am not going for a record:) and was not looking at dates.
Since it is still in the top of google search, wasn't closed thread and I found an issue I wanted to correct it...
6 years ago
I also got here from google. Good pattern but needs an update.

Tried to extend it so only one or two decimal places are accepted [0-9]{1,2}+ , and it didnt work. So I had to rewrite it from scratch.
In your pattern the last greedy quantifier (X)+ should be removed since it causing that strings like 1231.32131.333 are accepted.

So finally it should be: (-|\\+)?[0-9]+(\\.[0-9]+)?
and in case of limitimg decimal places (-|\\+)?[0-9]+(\\.[0-9]{1,2}+)?
6 years ago