473,322 Members | 1,778 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,322 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 1791
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.