============================================================================================= https://www.regular-expressions.info/javascript.html --------------------------------------------------------------------------------------------- /g enables “global” matching. When using the replace() method, specify this modifier to replace all matches, rather than only the first one. /i makes the regex match case insensitive. /m enables “multi-line mode”. In this mode, the caret and dollar match before and after line breaks in the subject string. /s enables “single-line mode”. In this mode, the dot matches line breaks. This modifier is new in ECMAScript 2018. Older browsers, including Internet Explorer and the original Edge, do not support it. You can combine multiple modifiers by stringing them together as in /regex/gim. Notably absent is an option to make the dot match line break characters. ============================================================================================= https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions#advanced_searching_with_flags --------------------------------------------------------------------------------------------- Flag Description Corresponding property d Generate indices for substring matches. hasIndices g Global search. global i Case-insensitive search. ignoreCase m Allows ^ and $ to match newline characters. multiline s Allows . to match newline characters. dotAll u "Unicode"; treat a pattern as a sequence of Unicode code points. unicode v An upgrade to the u mode with more Unicode features. unicodeSets y Perform a "sticky" search that matches starting at the current position in the target string. sticky =============================================================================================