Skip to content

Instantly share code, notes, and snippets.

@KinoAR
Created December 19, 2016 18:27
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 KinoAR/ddfcd9fd8f8ca82be31077ba546fde8e to your computer and use it in GitHub Desktop.
Save KinoAR/ddfcd9fd8f8ca82be31077ba546fde8e to your computer and use it in GitHub Desktop.
Tutorial Code for Regular Expressions
//=============================================================================
// RegExPatterns.js
//=============================================================================
'use strict';
//Pattern for: <cooldown: 12 >
//Pattern 1 matches < cooldown : 12 >, <cooldown:12>, <cooldown: 12>, etc
/<\s*cooldown\s*:\s*(\d+\.*\d*)\s*>/ig;
//Pattern 2 matches <cooldown:12> Only
/<cooldown:(\d+\.*\d*)>/ig;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment