let str = `JABBERSLYTHE M WS BS S T I Agi Dex Int WP Fel W 7 45 40 55 50 20 35 - 10 20 - 20 Traits: Armour 3, Bestial, Bite+9, Bounce, Corrosive Blood, Distracting, Infected, Maddening Aura (see page 17), Night Vision, Size (Enormous), Tail +8, Tongue Attack +5 (12), Venom, Weapon +9. `; import "./xregexp-all.js"; const us_carac = 'm\\s+ws\\s+bs\\s+s\\s+t\\s+i\\s+agi?\\s+dex\\s+int\\s+\\wp\\s+fel\\s+w'; const fr_carac = 'm\\s+ws\\s+bs\\s+s\\s+t\\s+i\\s+agi?\\s+dex\\s+int\\s+\\wp\\s+fel\\s+w'; const carac_val = '(?[0-9-]+)\\s+(?[0-9-]+)\\s+(?[0-9-]+)\\s+(?[0-9-]+)\\s+(?[0-9-]+)\\s+(?[0-9-]+)\\s+(?[0-9-]+)\\s+(?[0-9-]+)\\s+(?[0-9-]+)\\s+(?[0-9-]+)\\s+(?[0-9-]+)\\s+(?[0-9-]+)'; const traits = "Traits:" Hooks.once('init', () => { let t1 = "agi"; let reg0 = XRegExp('agi?', 'gi'); //console.log("PARSER pos 1: ", reg0.test( t1 ) ); let reg1 = XRegExp(us_carac, 'gi'); let res = reg1.test(str); //console.log("PARSER pos 2: ", res); if (res) { //stat block identified let reg2 = XRegExp(carac_val, 'gi') let res = XRegExp.exec(str, reg2); //console.log("Movement is : ", res); } //Do we have Traits ? })