Home Download Buy Blog Forum Support

Syntax Regex Help: \s* not matching linebreaks

Syntax Regex Help: \s* not matching linebreaks

Postby robertcollier4 on Tue Mar 12, 2013 6:18 pm

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

My syntax rule is:
Code: Select all
<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:
Code: Select all
WM_MOUSEMOVE(arg1) {


But it is NOT matching this:
Code: Select all
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?
robertcollier4
 
Posts: 154
Joined: Sun Feb 24, 2013 5:37 pm

Re: Syntax Regex Help: \s* not matching linebreaks

Postby adzenith on Wed Mar 13, 2013 5:10 pm

I believe that the regexes in .tmLanguage files are all single-line to improve parsing speed.
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm


Return to Technical Support

Who is online

Users browsing this forum: lecksfrawen and 17 guests