473,385 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Regular Expression for both integer and decimal values

GD
Hi,
Some one please points out what is wrong with the following custom
expression in a RegularExpressionValidator:

(\d{1,6})|(\d{1,6}\.\d{1,6})

The first part is for integer and the second part is for decimal. If I use
either part alone, they work fine. However, the "or"( | ) doesn't seem to
work. Please help. TIA.

GD

Nov 18 '05 #1
2 3276
I suggest to see this , it may help u out.
http://www.regexlib.com/ or
http://www.sellsbrothers.com/tools/#regexd

regards

"GD" <No*********@comcast.net> wrote in message
news:%2*****************@TK2MSFTNGP09.phx.gbl...
Hi,
Some one please points out what is wrong with the following custom
expression in a RegularExpressionValidator:

(\d{1,6})|(\d{1,6}\.\d{1,6})

The first part is for integer and the second part is for decimal. If I use
either part alone, they work fine. However, the "or"( | ) doesn't seem to
work. Please help. TIA.

GD

Nov 18 '05 #2
GD
Thanks Taed. The Expresso from http://www.ultrapico.com/ is great too.
"Raed Sawalha" <ra**********@hotmail.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
I suggest to see this , it may help u out.
http://www.regexlib.com/ or
http://www.sellsbrothers.com/tools/#regexd

regards

"GD" <No*********@comcast.net> wrote in message
news:%2*****************@TK2MSFTNGP09.phx.gbl...
Hi,
Some one please points out what is wrong with the following custom
expression in a RegularExpressionValidator:

(\d{1,6})|(\d{1,6}\.\d{1,6})

The first part is for integer and the second part is for decimal. If I
use
either part alone, they work fine. However, the "or"( | ) doesn't seem to
work. Please help. TIA.

GD


Nov 18 '05 #3

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

Similar topics

9
by: gary | last post by:
I want to pick all intergers and decimal numbers out of a string. Would this be the most correct regular expression to use? "\d+\.?\d*"
6
by: los | last post by:
Hi, I've created a web application using struts. I am trying to solve an issue where in one of the forms where I want to allow the values inserted to be special characters from other languages,...
8
by: Ahmad A. Rahman | last post by:
Hi all, I have a problem constructing a regular expression using .net. I have a string, separated with comma, and I want to group the string together but, I failed to group a numeric character...
5
by: bas jaburg | last post by:
Hi, I need to know the regular expression that checks the whether a 1-decimal number has been entered. Also it needs to ok if no trailing number before the decimal dot has been entered So:...
4
by: Daniel | last post by:
I would like to get some help on regular expression to validate decimal numbers. It should also match negative value, empty value. The expression:...
7
by: Tizzah | last post by:
What is wrong with that? regex = /^(http|https):\/\/+({1}+)*\.{2,5}(({1,5})?\/.*)?$/ if(field.hpage.value != regex.test(field.hpage.value)){ alert("Bad Homepage") field.hpage.focus()...
11
by: Steve | last post by:
Hi All, I'm having a tough time converting the following regex.compile patterns into the new re.compile format. There is also a differences in the regsub.sub() vs. re.sub() Could anyone lend...
10
by: Mike9900 | last post by:
Hello, I need a regular expression to match a currency with its symbol, for example Pound66.99 must return 66.99 or Pound(66.99) or Pound-66.99 or -66.99Pound return -66.99 or any other...
1
by: TARUN | last post by:
Hello All I want to ask regading regular expression. I want to use such regular expression which only allow integers and float value. for example :-- 12 12.34 23.456
11
by: Michael_Burgess | last post by:
Hi there, I'm using the following regex validator: ^\d{0,4}.?\d{0,2}$ This is to validate that a text box has 0-4 numbers, possible followed by a decimal point and possibly followed by 2...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.