Last active
December 19, 2016 18:57
-
-
Save KinoAR/ae65cbc0c8a22cfcdb11f287b2b1ee1f to your computer and use it in GitHub Desktop.
Tutorial Code for Regular Expressions Part 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//============================================================================= | |
// 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