Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Regular
Expressions
101
Regular
Expressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(?<!XXY)(?<=Y)\w(?=Y)(?!YYXX)
/
gm
Input 1
1
New
(?<!XXY)(?<=Y)\w(?=Y)(?!YYXX) ^ ^ ^ ^ ^ | | | | not before YYXX | | |before Y | |letter | followed by Y not followed by XXY X0XYXYYX X(?=Y) match X if before Y X(?!Y) match X if not before Y (?<=Y)X match X if followed by Y (?<!Y)X match X if not followed by Y
Extraction