Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2020-09-16 14:18
Flavor·JavaScript

/
(?<operator>[+\-])?(?:(?<dice>(?<numberOfDice>[\d]+)?[dD](?<faces>[\d]+)(?<explode>![\d]*)?(?<implode>¡[\d]*)?(?<selective>[kd][\d]+)?)|(?<constant>[\d]+))
/
gm
Open regex in editor

Description

Map operator, constants, number of dice, number of faces, exploding/imploding and selective dice notations

Submitted by anonymous