Test, validate and match regular expressions
This regex matches the literal substring 'test' anywhere in the input text. The global flag (g) ensures all occurrences are found rather than stopping at the first match, while the multiline flag (m) affects ^ and $ anchors but has no practical effect on this pattern. Commonly used for simple keyword searches, locating the word 'test' in logs or code, or filtering text lines containing it.