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
/
(?<operator>[+\-])?(?:(?<dice>(?<numberOfDice>[\d]+)?[dD](?<faces>[\d]+)(?<explode>![\d]*)?(?<implode>¡[\d]*)?(?<selective>[kd][\d]+)?)|(?<constant>[\d]+))
/
gm
Input 1
New
d4 1d4 1d20-10 2d6+1d8 3d10k2 3d10d2 6d6! 6d6!5 d100!96¡5 d6¡ d20¡2
Substitution
d4 1d4 1d20-10 2d6+1d8 3d10k2 3d10d2 6d6! 6d6!5 d100!96¡5 d6¡ d20¡2