Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
\b(?:(?:([a-z])(?=[a-z]*\1))+(?!\1))?([a-z])(?![a-z]*\2)
/
ig
Input 1
1
New
'NUNUMUNN' // expected output 'M' 'LOMING' // expected output 'L' I think it's possible to do this using general string operations, but my preference is really for pure regex. AAAAAAAAAAAAAAAAAAAAAA AXXXXXA XXXXXXA