Global (g) flag, and others

Hi, trivial question but who can write where they came from and provide a link to any specs/docs. I tried to find info about it without result.

global (g) flag, 

example:

let alphabetRegex = /[a-z]/gi;

Many thanks.

I did a search for “javascript regexp global flag” on duckduckgo and got several good links back. Here’s the first one.

Ok, thanks. I don’t think I’ve missed them during going thru chapters, it’s a bit mysterious for me.

*edit: got them here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/RegExp

MDN has an entire guide section on regex worth checking out as well. The global flag behavior depends on the method used so you should check the docs for whatever method you use (e.g. test vs match).

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.