Last updated 6 years ago
Was this helpful?
"aaaa".match(/[a]/)
Result:
["a"]
"a a123a a123a b123b c".match(/a(123)a/g)
["a123", "a123"]
Note the trailing /g
/g
You cannot select individual groups while using g
g