Is there a way to match any character in Sublime Text, including newlines? I saw that Sublime uses Boost's syntax but that the .
character won't match newlines without a specific flag set.
We want any number of characters that are not double quotes or newlines between the quotes. So the proper regex is "[^"\r\n]*". If your flavor supports the shorthand \v to match any line break character, then "[^"\v]*" is an even better solution.
Matching a Single Character Using Regex By default, the '. ' dot character in a regular expression matches a single character without regard to what character it is. The matched character can be an alphabet, a number or, any special character.
A metacharacter is a symbol with a special meaning inside a regex. The metacharacter dot ( . ) matches any single character except newline \n (same as [^\n] ).
To use regular expressions in Sublime Text, first activate them in the corresponding search panel by clicking on the available buttons or using keyboard shortcuts. If you don't activate regular expressions before performing a search, the search terms will be interpreted literally. Documentation on regular expressions.
Try adding the (?s)
inline flag start the start of the pattern. That will make .
match any character.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With