473,503 Members | 3,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

REGEX question

Can someone help me write a regex that will accept number but NO COMMAS.

Yes to
123456.78

No to
123,456.78

Thanks!
Phil
Dec 20 '07 #1
3 980
On Dec 20, 8:33 pm, "pvong" <phillip*at*yahoo*dot*comwrote:
Can someone help me write a regex that will accept number but NO COMMAS.

Yes to
123456.78

No to
123,456.78
Hi Phil,

Do you need it for the RegularExpressionValidator control?

Try this one

^\d+(\.\d\d)?$

Hope it works

Dec 20 '07 #2
On Dec 20, 8:38 pm, Alexey Smirnov <alexey.smir...@gmail.comwrote:
On Dec 20, 8:33 pm, "pvong" <phillip*at*yahoo*dot*comwrote:
Can someone help me write a regex that will accept number but NO COMMAS.
Yes to
123456.78
No to
123,456.78

Hi Phil,

Do you need it for the RegularExpressionValidator control?

Try this one

^\d+(\.\d\d)?$

Hope it works
If the digits after the decimal point are always there:

^\d+\.\d\d$
Dec 20 '07 #3
Yes and this is perfect!!!!
Thanks!
"Alexey Smirnov" <al************@gmail.comwrote in message
news:d8**********************************@i3g2000h sf.googlegroups.com...
On Dec 20, 8:33 pm, "pvong" <phillip*at*yahoo*dot*comwrote:
>Can someone help me write a regex that will accept number but NO COMMAS.

Yes to
123456.78

No to
123,456.78

Hi Phil,

Do you need it for the RegularExpressionValidator control?

Try this one

^\d+(\.\d\d)?$

Hope it works

Dec 20 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4345
by: engwar1 | last post by:
Not sure where to ask this. Please suggest another newsgroup if this isn't the best place for this question. I'm new to both vb.net and regex. I need a regular expression that will validate what...
4
9700
by: aevans1108 | last post by:
expanding this message to microsoft.public.dotnet.xml Greetings Please direct me to the right group if this is an inappropriate place to post this question. Thanks. I want to format a...
2
3410
by: Tim Conner | last post by:
Hi, Thanks to Peter, Chris and Steven who answered my previous answer about regex to split a string. Actually, it was as easy as create a regex with the pattern "/*-+()," and most of my string...
6
396
by: Du Dang | last post by:
Text: ===================== <script1> ***stuff A </script1> ***more stuff <script2> ***stuff B
17
3941
by: clintonG | last post by:
I'm using an .aspx tool I found at but as nice as the interface is I think I need to consider using others. Some can generate C# I understand. Your preferences please... <%= Clinton Gallagher ...
5
5076
by: Chris | last post by:
How Do I use the following auto-generated code from The Regulator? '------------------------------------------------------------------------------ ' <autogenerated> ' This code was generated...
6
5849
by: Martin Evans | last post by:
Sorry, yet another REGEX question. I've been struggling with trying to get a regular expression to do the following example in Python: Search and replace all instances of "sleeping" with "dead"....
7
2565
by: Extremest | last post by:
I am using this regex. static Regex paranthesis = new Regex("(\\d*/\\d*)", RegexOptions.IgnoreCase); it should find everything between parenthesis that have some numbers onyl then a forward...
6
4190
by: Phil Barber | last post by:
I am using Regex to validate a file name. I have everything I need except I would like the dot(.) in the filename only to appear once. My question is it possible to allow one instance of character...
6
2053
by: | last post by:
Hi all, Sorry for the lengthy post but as I learned I should post concise-and-complete code. So the code belows shows that the execution of ValidateAddress consumes a lot of time. In the test...
0
7064
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7315
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.