- Joined
- Mar 28, 2016
- Messages
- 1,623
- Reaction score
- 1,439
- First Language
- French
- Primarily Uses
- RMMV
Hi
I have something like this
TXTitem =
"
#Cadre: D4 Fire
#Slot: Dice
#type: Power
";
I need to get text after #Cadre:
How to get te full text with space.
I try this
var matches = /#Cadre: (\w+)\s/.exec(TXTitem);
or this
var matches = /#Cadre: (\w+)\s+/.exec(TXTitem);
but this return me only D4, i need get D4 Fire .
Regex is very hard to understand!
Tanks
Here the full portion of code
I have something like this
TXTitem =
"
#Cadre: D4 Fire
#Slot: Dice
#type: Power
";
I need to get text after #Cadre:
How to get te full text with space.
I try this
var matches = /#Cadre: (\w+)\s/.exec(TXTitem);
or this
var matches = /#Cadre: (\w+)\s+/.exec(TXTitem);
but this return me only D4, i need get D4 Fire .
Regex is very hard to understand!
Tanks
Here the full portion of code
Code:
//get the .note item selected
var TXTitem = $dataItems[DiceSlotBig[WhatSlotcliked][3]].note;
// Find in the .note item what have after #Cadre:
var matches = /#Cadre: (\w+)\s+/.exec(TXTitem);
console.log (matches[1]); // it supose to are D4 Fire but i have D4
//Show text to screen
$gameScreen.setDTextPicture('\\OW[4] ' + matches[1] + ' ', 24); //affiche item id .name
$gameScreen.setFont('GameFont');
$gameScreen.showPicture(57, '', 1, TempX, TempY, 0, 0, 255, 0);
this.bindPictureToMap((57), 1, 'above_characters');
Last edited by a moderator:


