In my program, I need a regx that says the format can be
Numeric only with this pattern: 1,3,56,8 or 2
In other words, if there's just one number it passes. However, if there are
2 or more they must be separated by a comma.
Basically (I know this doesn't work)
[0-9] or ([0-9], AND ^[a-zA-Z] {1,5}
TIA 2 2392
On 2004-12-29, Raven <ra*********@NOSPAMravenphpscripts.com> wrote: In my program, I need a regx that says the format can be Numeric only with this pattern: 1,3,56,8 or 2 In other words, if there's just one number it passes. However, if there are 2 or more they must be separated by a comma.
Basically (I know this doesn't work) [0-9] or ([0-9], AND ^[a-zA-Z] {1,5}
If you want to match one or more numbers separated by commas, try this:
^[0-9]+(,[0-9]+)*$
Regards
Matthias
"Matthias Czapla" <la*@dexato.mine.nu> wrote in message
news:cq*************@news.t-online.com... On 2004-12-29, Raven <ra*********@NOSPAMravenphpscripts.com> wrote: In my program, I need a regx that says the format can be Numeric only with this pattern: 1,3,56,8 or 2 In other words, if there's just one number it passes. However, if there are 2 or more they must be separated by a comma.
Basically (I know this doesn't work) [0-9] or ([0-9], AND ^[a-zA-Z] {1,5}
If you want to match one or more numbers separated by commas, try this:
^[0-9]+(,[0-9]+)*$
Regards Matthias
Thank you so much! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Dave |
last post by:
I'm struggling with something that should be fairly simple. I just don't
know the regext syntax very well, unfortunately.
I'd like to parse words out of what is basically a boolean search...
|
by: jeevankodali |
last post by:
Hi
I have an .Net application which processes thousands of Xml nodes each
day and for each node I am using around 30-40 Regex matches to see if
they satisfy some conditions are not. These Regex...
|
by: clintonG |
last post by:
I'm using an .aspx tool I found at but as nice as the interface is I
think I need to consider using others. Some can generate C# I understand.
Your preferences please...
<%= Clinton Gallagher
...
|
by: Mike Labosh |
last post by:
I have the following System.Text.RegularExpressions.Regex that is supposed
to remove this predefined list of garbage characters from contact names that
come in on import files :
Dim...
|
by: jmchadha |
last post by:
I have got the following html:
"something in html ... etc.. city1... etc... <a class="font1"
href="city1.html" onclick="etc."click for <b>info</bon city1 </a>
... some html. city1.. can repeat...
| |
by: Chris |
last post by:
Hi Everyone,
I am using a regex to check for a string. When all the file contains is my
test string the regex returns a match, but when I embed the test string in
the middle of a text file a...
|
by: Extremest |
last post by:
I am using this regex.
static Regex paranthesis = new Regex("(\\d*/\\d*)",
RegexOptions.IgnoreCase);
it should find everything between parenthesis that have some numbers
onyl then a forward...
|
by: Phil Barber |
last post by:
I am using Regex to validate a file name. I have everything I need except I
would like the dot(.) in the filename only to appear once. My question is it
possible to allow one instance of character...
|
by: jonnyboy6969 |
last post by:
Hi All
Really hoping someone can help me out here with my deficient regex skills :)
I have a function which takes a string of HTML and replaces a term (word or phrase) with a link. The pupose...
|
by: Support Desk |
last post by:
That’s it exactly..thx
-----Original Message-----
From: Reedick, Andrew
Sent: Tuesday, June 03, 2008 9:26 AM
To: Support Desk
Subject: RE: regex help
The regex will now skip anything with...
|
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...
| |
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |
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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |