/.*/
works great if there are no line breaks. If it has to match line breaks, here are some solutions:
Solution | Description |
---|---|
/.*/s |
/s (dot all flag) makes . (wildcard character) match anything, including line breaks. Throw in an * (asterisk), and it will match everything. Read more. |
/[\s\S]*/ |
\s (whitespace metacharacter) will match any whitespace character (space; tab; line break; ...), and \S (opposite of \s ) will match anything that is not a whitespace character. * (asterisk) will match all occurrences of the character set (Encapsulated by [] ). Read more. |