- Joined
- Jan 26, 2014
- Messages
- 1,281
- Reaction score
- 106
- First Language
- Irish
- Primarily Uses
- N/A
Can someone explain this?
For example, in my event, I did a comment:
<sound: 4>
<picture: 6>
Now, I am told that we can use .contains or .match. WhenI do this:
if (this.page().list.parameters[0].match(/<sound:\s*(\d+)?>/im)) {
var sound = this.page().list.parameters[0].match(/<sound:\s*(\d+)?>/im)[1];
this.eventSoundNumber = Number(sound);
}
It won't actually read the value and place it to my new variable eventSoundNumber. In my understanding, it should be able to since it is matching the expression. When I use contains it just do the same. Is there a way to check the <sound: x> tag while keeping <picture: x> or vice versa?
For example, in my event, I did a comment:
<sound: 4>
<picture: 6>
Now, I am told that we can use .contains or .match. WhenI do this:
if (this.page().list.parameters[0].match(/<sound:\s*(\d+)?>/im)) {
var sound = this.page().list.parameters[0].match(/<sound:\s*(\d+)?>/im)[1];
this.eventSoundNumber = Number(sound);
}
It won't actually read the value and place it to my new variable eventSoundNumber. In my understanding, it should be able to since it is matching the expression. When I use contains it just do the same. Is there a way to check the <sound: x> tag while keeping <picture: x> or vice versa?


