It seems there are 7 JS RegExp modifiers:
d
indicesg
globali
casem
multilines
dotallu
unicodey
sticky
Which of the above are applicable for doing regex.test(string)
? For example, since it just tests whether the string contains one or more matches or not, isn’t the g
flag N/A for it? In other words:
/h/.test("h h h h") === /h/g.test("h h h h")
i
, m
, s
, and u
seem like they would be applicable, but I’m also not certain about d
(I think not since it relates to indices and this just returns a bool?) or y
(I think yes). Which modifiers make sense for the .test()
method?