Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
\b\w{4}\b
/
gm
Input 1
1234567890abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz1234567890 ab cde fghi jklmn opqrstuvwxyz // word boundary Exercise: Match name that has only 4 characters Jeremy Shada John DiMaggio Hynden Walch Tom Kenny Olivia Olson Niki Yang Pendleton Ward Fred Melamed Hayden Ezzy Justin Roiland Sean Giambrone Willow Smith Tom Scharpling Maria Bamford Felicia Day Jessica DiCicco Andy Milonakis Ashley Eriksson Bettie Ward Steve Little Dee Bradley Baker Jill Talley Steve Agee // character class capture group Exercise: grab hexcodes only Primary: #0050A3 Secondary: #FFFFFF Primary: #FFFFFF Secondary: 0050A3 Primary 002556 Secondary: A08E66
Substitution
1234567890abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz1234567890 ab cde fghi jklmn opqrstuvwxyz // word boundary Exercise: Match name that has only 4 characters Jeremy Shada John DiMaggio Hynden Walch Tom Kenny Olivia Olson Niki Yang Pendleton Ward Fred Melamed Hayden Ezzy Justin Roiland Sean Giambrone Willow Smith Tom Scharpling Maria Bamford Felicia Day Jessica DiCicco Andy Milonakis Ashley Eriksson Bettie Ward Steve Little Dee Bradley Baker Jill Talley Steve Agee // character class capture group Exercise: grab hexcodes only Primary: #0050A3 Secondary: #FFFFFF Primary: #FFFFFF Secondary: 0050A3 Primary 002556 Secondary: A08E66