mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-29 14:36:22 +00:00
352 B
352 B
id | title |
---|---|
8bf1886a-0754-467f-a441-cb21bccfbd46 | JavaScript RegExp /s flag |
Introduction
The dot (.) in regular expressions doesn't match line terminator characters:
console.log(/%.$/.test('\n')) // false
The /s
expression (dotAll) flag fixes this.
Syntax
console.log(/^.$/s.test("\n")); // true