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
/
\s(\d+)[ \/](\d+)(\s|$)
/
Unit Tests
5
20
rspec
→ regex does not match
5
20
→ regex does not match
rspec
0
20
1st
→ regex does match
rspec
5
20
30
→ regex does not match
rspec
0
20_
→ regex does not match
rspec
0
20-
→ regex does not match
rspec
0
20
→ regex does match
rspec
1st
of
20
→ regex does not match
rspec
0
20
→ capture group 0 contains
0
20
rspec
0
→ regex does not match
rspec
0
20th
→ regex does not match
rspec
5-24-16
→ regex does not match
rspec
5/20
ruby21
→ capture group 0 contains
5/20
rspec
5-20
→ regex does not match
rspec5-20
→ regex does not match
rspec5/20
→ regex does not match
rspec
5
→ regex does not match
rspec
5/20
ruby21
→ regex does match
rspec
4/20
→ regex does match
rspec
0
20
→ regex does match