Sublime Forum

Syntax Regex Help: \s* not matching linebreaks

#1

From the TextMate RegEx Manual, it says that \s matches line breaks as well.

My syntax rule is:

<dict> <key>name</key> <string>entity.name.function.ahk</string> <key>match</key> <string>^\S*\(.*\)\s*{</string> <!-- line beginning, non-whitespace chars, openparen, anychars, closeparen, whitespace chars, openbracket --> </dict>

It is matching this successfully:

WM_MOUSEMOVE(arg1) {

But it is NOT matching this:

WM_MOUSEMOVE(arg1) {

I tried it in RegexBuddy and it says both should match. Does anyone know why Sublime is not matching the last example?

0 Likes

#2

I believe that the regexes in .tmLanguage files are all single-line to improve parsing speed.

0 Likes