Title |
Test
Find
Multisided dice
|
Expression |
([1-9]{1,2})?(d|D)([1-9]{1,3})((\+|-)([1-9]{1,3}))? |
Description |
For the geeks out there, you can use this to break down die rolls of multisided dice for things like role playing games. Includes support for a die multiplier and an end modifier value. Supports a multiplier up to 99, and sides and a modifier of up to 999. |
Matches |
d12 | 2d4 | 3D8-2 | 99D999+999 |
Non-Matches |
0d6 | 100d4 | 2a4 | 3D8*3 |
Author |
Rating:
Michael Fienen
|
Source |
|
Your Rating |
|
Title: Modified Version
Name: formlesstree4
Date: 2/8/2015 11:19:46 PM
Comment:
Brandon. Try this:
([1-9]{1,2})?(d|D)([1-9]{1,1}([0-9]{1,2})?)((\+|-)([1-9]{1,3}))?
Title: Modifier only works if single digit
Name: Branden
Date: 2/4/2015 9:22:11 PM
Comment:
Your regex LOOKS like it should work, but the RegEx testers I ran it against only capture the first digit of the modifier. For example, with "2D6+100", only "2D6+1" is matched. I'm puzzled as to why it doesn't work, however.
I tested it here: http://www.freeformatter.com/regex-tester.html
And here: http://myregexp.com/