[thelist] reg expression question

Howard Cheng howcheng at ix.netcom.com
Mon Oct 14 12:28:10 CDT 2002


I believe you're looking for something like:

[0-9,]{3,}

Of course, this will also pick work with patterns with mutiple commas, such
as 1,2,3, which I assume is not what you want to get. If you're intent on
avoiding that match, you'll have to do something more complex, like:

[0-9]{0,3},?[0-9]{3}

At 12:59 PM 10/14/2002 -0400, Michael Robertson wrote:
>--
>[ Picked text/plain from multipart/alternative ]
>I've been trying to come up with an expression that seems easy but it's
>not working. I want to match an integer that is at least 3 digits long and
>MIGHT have a comma:
>
>325
>3459
>3,459
>10300
>10,300
>
>are all acceptable examples.
>
>everytime i try to do something to match the comma it doesn't work. Any
>suggestions? Thanks

::::::::::::::::::::::::::::::::::
Howard Cheng
http://www.howcheng.com/ <-- NEW!
howcheng at ix dot netcom dot com
AIM: bennyphoebe
ICQ: 47319315




More information about the thelist mailing list