Skip to content

Instantly share code, notes, and snippets.

@KinoAR
Last active December 19, 2016 18:57
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/ae65cbc0c8a22cfcdb11f287b2b1ee1f to your computer and use it in GitHub Desktop.
Save KinoAR/ae65cbc0c8a22cfcdb11f287b2b1ee1f to your computer and use it in GitHub Desktop.
Tutorial Code for Regular Expressions Part 2
//=============================================================================
// RegExPatterns.js
//=============================================================================
//Reading note tag from skill data in RMMV: $dataSkills is for skill data.
$dataSkills.slice(1).forEach(function(skill) {
'use strict';
let data = /<\s*cooldown\s*:\s*(\d+\.*\d*)\s*>/ig.exec(skill.note);
if(data !== null ) {
console.log(data); //["<cooldown: 12 >", "12", index: 0, input: "<cooldown: 12 >"]
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment