Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: .NET1.1 C# ASP.NET , +
Hi all,
I want to use a regular expression statement in my 1.1 project to validate float numbers which can have ", . " as floating seperators. I am new in this topic, please help me.
Thanks in advance.
Posted 15-Nov-12 22:40pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

kurtiniadiss at 16-Nov-12 5:54am
Thank you very much OriginalGriff it works perfectly for floating point numbers, but there is one more problem. I want integers to be included in this control, I forgot to add them into the question :(
Milind Thakkar at 16-Nov-12 5:55am
This regex should work for int as well. Did you try?
OriginalGriff at 16-Nov-12 6:01am
Um - it won't! :laugh:
Milind Thakkar at 16-Nov-12 6:02am
:-( . Yup requires ? or probably * will also do, right?
OriginalGriff at 16-Nov-12 6:48am
? - Yes.
* - No.
"*" would allow 1.2,2.2.2,2
OriginalGriff at 16-Nov-12 6:00am
Add a question mark to the end: that makes the last part optional with zero or one repetitions:
kurtiniadiss at 16-Nov-12 6:23am
excellent! thank you so much:)
OriginalGriff at 16-Nov-12 6:48am
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 315
1 Sergey Alexandrovich Kryukov 201
2 ChauhanAjay 156
3 PhilLenoir 154
4 ClimerChinna 140
0 Sergey Alexandrovich Kryukov 6,140
1 OriginalGriff 5,195
2 CPallini 2,473
3 Richard MacCutchan 1,607
4 Abhinav S 1,505

Advertise | Privacy | Mobile
Web02 | 2.8.140814.1 | Last Updated 16 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100