![aquamacs regex newline aquamacs regex newline](https://docs.memoq.com/current/en/Images/r-s/regextagger.png)
Since all characters are either whitespace or non-whitespace, this character class matches any character. This character matches a character that is either a whitespace character (including line break characters), or a character that is not a whitespace character. In JavaScript (for compatibility with older browsers) and VBScript you can use a character class such as to match any character. NET’s Regex class you activate this mode by specifying RegexOptions.Singleline, such as in Regex.Match("string", "regex", RegexOptions.Singleline). Other languages and regex libraries have adopted Perl’s terminology. You can activate single-line mode by adding an s after the regex code, like this: m/^regex$/s. Multi-line mode only affects anchors, and single-line mode only affects the dot. This is a bit unfortunate, because it is easy to mix up this term with “multi-line mode”. In Perl, the mode where the dot also matches line breaks is called “single-line mode”. In EditPad Pro, turn on the “Dot” or “Dot matches newline” search option. In PowerGREP, tick the checkbox labeled “dot matches line breaks” to make the dot match all characters. It was formally added in the ECMAScript 2018 specification.
![aquamacs regex newline aquamacs regex newline](https://community.notepad-plus-plus.org/assets/uploads/files/1645600788417-datesr2.png)
Older implementations of JavaScript don’t have the option either. Except for VBScript, all regex flavors discussed here have an option to make the dot match all characters, including line breaks. Modern tools and languages can apply regular expressions to very large strings or even entire files. The effect is that with these tools, the string could never contain line breaks, so the dot could never match them. They would read a file line by line, and apply the regular expression separately to each line. The first tools that used regular expressions were line-based. This exception exists mostly because of historic reasons.
![aquamacs regex newline aquamacs regex newline](https://www.technical-recipes.com/wp-content/uploads/2020/06/regex4.png)
In all regex flavors discussed in this tutorial, the dot does not match line breaks by default. The only exception are line break characters. The dot matches a single character, without caring what that character is. Unfortunately, it is also the most commonly misused metacharacter. In regular expressions, the dot or period is one of the most commonly used metacharacters.