K
K
Keterone2021-06-17 18:58:33
Regular Expressions
Keterone, 2021-06-17 18:58:33

Why is index not passed using global search?

I made a simple script that will replace forbidden words with *, but for some reason, when I give the regular expression a global search (g), then only matches are returned to me, but not their

PS index, I use .match()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Simkav, 2021-06-17
@Keterone

str.match()

If the regular expression contains the g flag, the method will return an array containing all matches. If there were no mappings, the method will return null.

ps
next. once specify the language

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question