Test, validate and match regular expressions
This regex tokenizes dice notation and arithmetic expressions. It matches dice rolls (e.g., 3d6, d20), plain integers, addition/subtraction signs, and multiplication/division operators. Useful for parsing tabletop RPG dice commands or building a simple calculator for dice-based games.