Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE2 (PHP >=7.3)

/
(?<!\S)(?P<set> (?:(?P<a>A) | (?P<b>B) | (?P<c>C)) (?: (?(a) (?!A)) (?(b) (?!B)) (?(c) (?!C)) (?&set) )? )\s
/
gmx

Description

Matches any non-repetitive permutations of characters in a set, separated by whitespaces. For the set of characters ABC: Matches: A, BAC, CA... Doesn't match: BB, ABA, CBD...

Submitted by nuru - 5 months ago (Last modified 5 months ago)