By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,208 Members | 1,592 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,208 IT Pros & Developers. It's quick & easy.

Regular Expression - Numbers

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
Well, figured it out. I do appreciate the veritable glut of responses, though....
Jul 21 '05 #2

P: n/a
Well, figured it out. I do appreciate the veritable glut of responses, though....
Jul 21 '05 #3

P: n/a
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

P: n/a
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.