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
/
roll (\d+)d(\d+)([\+-]\d+)?$
/
ig
Unit Tests
roll
1d20+42
→ regex does match
roll
1d20a1
→ regex does not match
roll
1d20*1
→ regex does not match
roll
1d20-1
→ regex does match
roll
1d20+1
→ regex does match
roll
1d1234
→ regex does match
roll
1d20
→ regex does match
roll
1d100
→ regex does match
roll
1d10
→ regex does match