A
A
Artem00712017-09-18 14:18:47
JavaScript
Artem0071, 2017-09-18 14:18:47

How to fix a regular expression?

There is a block containing the following class:
param-out goTo goTo_1_1_1 goTo_2_1_2

let block = goTo[i].className.animVal.match(/goTo_(\w+)/);

if (block === null)
      continue;

console.log(block);

Outputs:
["goTo_1_1_1", "1_1_1", index: 23, input: "fa-icon param-out goTo goTo_1_1_1 goTo_2_1_2"]

I need to display all the options goTo_*_*_* (for good, I need exactly the numbers after goTo)
And now it turns out that it displays only the first part (instead of an array, only one element is obtained)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
ns5d, 2017-09-18
@Artem0071

https://regex101.com/r/eD1Tud/1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question