gnu-regexp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Regexp] (no subject)


From: Hartwig, Thomas
Subject: Re: [Regexp] (no subject)
Date: Tue, 26 Aug 2003 10:34:15 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030507

If I understand you correct. You can catch this with repeating operators. See this from the manual:


-----------------------------------------------
# Repeating Operators
These symbols operate on the previous atomic expression.

    ? matches the preceding expression or the null string
* matches the null string or any number of repetitions of the preceding expression
    + matches one or more repetitions of the preceding expression
    {m} matches exactly m repetitions of the one-character expression
{m,n} matches between m and n repetitions of the preceding expression, inclusive
    {m,} matches m or more repetitions of the preceding expression
-----------------------------------------------



[a-zA-Z0-9,.'&@_-]{2,} would catch all occurences of at least two of your character class.

Greetings
Thomas


MarK Neisler wrote:
I have a problem that I am trying to solve using regular expressions.

To validate form input we have a java bean that will take a regular expression to match for validation.

Here is the regular expression I have.

[a-zA-Z0-9,.'&@_-]

this works however I need a regular expression that will disallow any of the symbols being next to each other in the string. for instance -- -, @@ &' ,- and so on. Any suggestions? I have been working on this for 3 days any help greatly appreciated.


------------------------------------------------------------------------
*Get MSN 8* and help protect your children with advanced parental controls. <http://g.msn.com/8HMIENUS/2743??PS=>


------------------------------------------------------------------------

_______________________________________________
Gnu-regexp-users mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/gnu-regexp-users

--
Firma Thomas Hartwig                        Telefon: 030-69599727
Software & IT-Service Spezialisten                www.crapoud.com
Boppstr. 11                                     Fax: 030-69599726
D-10967 Berlin                              GnuPG/PGP: 0xC51B523B





reply via email to

[Prev in Thread] Current Thread [Next in Thread]