469,964 Members | 1,774 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

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 1651
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mike | last post: by
3 posts views Thread by Robert Scheer | last post: by
3 posts views Thread by James D. Marshall | last post: by
14 posts views Thread by olekristianvillabo | last post: by
3 posts views Thread by Zach | last post: by
3 posts views Thread by dmalhotr2001 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.