RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
(?i:([A-D])(?!\1)([A-D])(?!\1|\2)([A-D])(?!\1|\2|\3)([A-D]))
Description
This regex validates a string of non-repeating characters A, B, C, D.
Matches
abcd | dbca | badc
Non-Matches
abba | baaa | cabb
Author Rating: Not yet rated. Michael Ash
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Re: Avoid Consecutive spaces
Name: Michael Ash
Date: 10/22/2004 11:44:31 PM
Comment:
Allow and avoid in what? A sentence? An Equation? A phone number? It may be easier to trim extra spaces.


Title: Avoid Consecutive spaces
Name: mansoor
Date: 10/22/2004 12:42:38 PM
Comment:
Hi, How can we allow spaces but avoid consecutive spaces. Any help would be appreciated. Thanks


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials