Home
Tester
Reference
About
Pattern
(X|(?!^)\G)Y(?=Y*X)
Input
XY
Y
XY
XY
X
XYYXY XYX
Options
Ignore Case
Ignore Whitespace
Explicit Capture
Culture Invariant
Singleline
Multiline
Right To Left
ECMA Script
Start from position:
Max matches to find:
Replacement
Replace matches with...
$1Z
Click the
context
tab to see replacements.
Regex Info
Table
Context
Split List
3
matches found in about
6
milliseconds.
Show Permalink
Permalink
Index
Position
Matched String
Replacement
$1
0
0
XY
XZ
X
1
2
Y
Z
empty string
2
7
XY
XZ
X
XZ
Z
XY
XZ
X
empty string
X
empty string
empty string
XY
X
X