1
I have the following code:
var str = "141271999 243306211 172266710 172266710 172266710";
var regex = /[0-9]{9}/g; //Encontrar 9 números entre 0-9 e retornar todos valores (g).
var idsEncontrados = str.match(regex);
How can I set my regex to disregard duplicate values found by making my variable idsEncontrados receive only the values 141271999, 243306211, 172266710?
It’s not easier implement this logic filtering the repeated in
idsEncontrados?– Woss
is a possibility...but I imagine there might be some flag or something like that to set up the regex this way.
– Fábio Junio Alves Sousa