Skip to content

Instantly share code, notes, and snippets.

@mgreenly
Created March 15, 2023 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgreenly/72c195c1e40391762aa28b9ee20b8653 to your computer and use it in GitHub Desktop.
Save mgreenly/72c195c1e40391762aa28b9ee20b8653 to your computer and use it in GitHub Desktop.
qty, size, bonus = "3d6-1"
.match(/^(\d+)d(\d+)([+-]\d+)?/)
.captures
.map(&:to_i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment