473,396 Members | 2,039 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,396 software developers and data experts.

Regular Expression - Numbers

I'm trying to come up with a regular expression that matches numbers with commas... but doesn't match numbers formatted without commas. The problem is that I'm trying to parse a file where the columns run together sometimes. For example

987,456,321123,456,78

This matches for the following regular expression
[-+]?(\d|,)*\.?\

What I'd like to to is only match up to three numbers between commas so that the preceding example would come back as two separate matches. I don't have a lot of experience with regular expressions and I haven't been able to find anything that does what I want. I'm hoping someone can help me. Thanks in advance

Mike
Jul 21 '05 #1
4 1798
Well, figured it out. I do appreciate the veritable glut of responses, though....
Jul 21 '05 #2
Well, figured it out. I do appreciate the veritable glut of responses, though....
Jul 21 '05 #3
Always best to get it yourself! :-)

I presume you're using [2] instead of * now, but I found this site useful
when I was doing regexs a lot
http://www.english.uga.edu/humcomp/p...pressions.HTML

Steve

"Mike" <an*******@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
Well, figured it out. I do appreciate the veritable glut of responses,

though....
Jul 21 '05 #4
Always best to get it yourself! :-)

I presume you're using [2] instead of * now, but I found this site useful
when I was doing regexs a lot
http://www.english.uga.edu/humcomp/p...pressions.HTML

Steve

"Mike" <an*******@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
Well, figured it out. I do appreciate the veritable glut of responses,

though....
Jul 21 '05 #5

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

Similar topics

1
by: Kenneth McDonald | last post by:
I'm working on the 0.8 release of my 'rex' module, and would appreciate feedback, suggestions, and criticism as I work towards finalizing the API and feature sets. rex is a module intended to make...
0
by: Mike | last post by:
I'm trying to come up with a regular expression that matches numbers with commas... but doesn't match numbers formatted without commas. The problem is that I'm trying to parse a file where the...
4
by: Arne | last post by:
Hi, I'm trying to recognise phone numbers on the following format using regular expressions: +47 123 45 678 This should be recognised by the following regular expression: +47 \d{3} \d{2}...
3
by: Robert Scheer | last post by:
Hi. I have a regularexpression validator control on a page. This regular expression validates a textbox to accept only numbers and commas: validationexpression="*" I am trying to modify this...
3
by: James D. Marshall | last post by:
The issue at hand, I believe is my comprehension of using regular expression, specially to assist in replacing the expression with other text. using regular expression (\s*) my understanding is...
14
by: olekristianvillabo | last post by:
I have a regular expression that is approximately 100k bytes. (It is basically a list of all known norwegian postal numbers and the corresponding place with | in between. I know this is not the...
3
by: Zach | last post by:
Hello, Please forgive if this is not the most appropriate newsgroup for this question. Unfortunately I didn't find a newsgroup specific to regular expressions. I have the following regular...
10
by: venugopal.sjce | last post by:
Hi Friends, I'm constructing a regular expression for validating an expression which looks as any of the following forms: 1. =4*++2 OR 2. =Sum()*6 Some of the samples I have constructed...
8
by: cokofreedom | last post by:
I was reading up on this site http://www.noulakaz.net/weblog/ 2007/03/18/a-regular-expression-to-check-for-prime-numbers/] of an interesting way to work out prime numbers using Regular Expression....
3
by: dmalhotr2001 | last post by:
Hi, I would like to know how to write regular expression in vb.net that would be valid for a piece of text that is only numbers, letters, dashes, and underscores that is allowed. Thanks :D
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.