- Save Regexctrl+s
- Update Regexctrl+⇧+s

- PCRE2 (PHP >=7.3)
- PCRE (PHP <7.3)
- ECMAScript (JavaScript)
- Python
- Golang
- Java 8

- Match
- Substitution
- List
- Unit Tests (12)

Sponsor

Jamstack at Scale

/

((?=(?=.*
(\2?(.?))).*\3.*(
\2))){1,481}?.*\4$

/

1st Capturing Group

((?=(?=.*
(\2?(.?))).*\3.*(
\2))){1,481}?

{1,481}? matches the previous token between 1 and 481 times, as few times as possible, expanding as needed (lazy)

A repeated capturing group will only capture the last iteration. Put a capturing group around the repeated group to capture all iterations or use a non-capturing group instead if you're not interested in the data

Positive Lookahead

(?=(?=.*
(\2?(.?))).*\3.*(
\2))

Assert that the Regex below matches

Positive Lookahead

(?=.*
(\2?(.?)))

Assert that the Regex below matches

.

matches any character (except for line terminators)* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)

↵ matches the character ↵ with index 10_{10} (A_{16} or 12_{8}) literally (case sensitive)

2nd Capturing Group

(\2?(.?))

\2

matches the same text as most recently matched by the 2nd capturing group? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)

3rd Capturing Group

(.?)

.

matches any character (except for line terminators)? matches the previous token between zero and one times, as many times as possible, giving back as needed (greedy)

.

matches any character (except for line terminators)* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)

\3 matches the same text as most recently matched by the 3rd capturing group

.

matches any character (except for line terminators)* matches the previous token between zero and unlimited times, as many times as possible, giving back as needed (greedy)

4th Capturing Group

(
\2)

↵ matches the character ↵ with index 10_{10} (A_{16} or 12_{8}) literally (case sensitive)

\2 matches the same text as most recently matched by the 2nd capturing group

.

matches any character (except for line terminators)\4 matches the same text as most recently matched by the 4th capturing group

$ asserts position at the end of the string, or before the line terminator right at the end of the string (if any)

/

/

"abcdef", "defbca"

"", ""

"abcdef", "abc"

"😀😁😆", "😁😆😀"

"abcccdee", "decbbbaa"

"abcccdee", "ddd"

"abcdef", ""

"abc", "abc123"

"def", "abcdef"

"", "a"

"abcdef", "bcdefg"

"😀😁😆", "😀😁😆🀀"

Please wait while the app is loading...