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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Separated Elements
Expression
^(?P<element>Element[0-9]+)(Separator(?P>element))*$
Description
An expression to verify whether a string contains elements of a specific pattern, separated by some separator. It is written in a generic form, so you can adapt it to your requirements. Of course the expression can be nested, in case you have elements that contain separated elements for their part. Some keywords for comprehension: named capture group, subroutine.
Matches
Element1SeparatorElement2 | Element1SeparatorElement2SeparatorElement3 | ElementSeparatorElementSeparatorElement
Non-Matches
ElementSeparatorBrokenElementSeparatorElement | ElementSeparatorElementSeparator | ElementSeparatorSeparatorElement
Author Rating: Not yet rated. jay-em
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: 3rd Matches test case is not valid
Name: Erwin
Date: 1/30/2016 5:18:19 AM
Comment:
The 3rd case from the Matches does not actually match. After "Element", a number must follow according to the regexp. The test case does not have that.


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