|
-
Sep 14th, 2015, 12:50 AM
#1
Thread Starter
Frenzied Member
Some advice on regular expressions
Although not directly related to vb.net, I couldn't find a better home for this question.
I am doing on my form some input validation, and trying to come up with a regular expression that will allow me to input positive decimals with both , and . as delimiter, no matter which is the current locale. Everything is working "almost perfectly.
This is the reg exp I am using: ^[0-9.,\-]+$
It works okay with one problem. It allows me to input multiple dots and commas. For example 2,.,.,.,.4 it allows.
How can I write this regexp so it only allow ONE , or . after the first number?
best regards
H
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|