Home Download Buy Blog Forum Support

Regex support -- doesn't ST2 use the Boost library?

Regex support -- doesn't ST2 use the Boost library?

Postby nick. on Mon Mar 26, 2012 7:20 pm

As documented here, seems like this should work:

Code: Select all
\b([a-zA-Z\-:]+)\s*=\s*(("|')?.*?(?3\s:\3)))
                                  ^^ errors out


But I'm getting an "invalid group option" error. Trying to extend the HTML syntax with attribute-value in addition to attribute-name:
<body style="background-color: #FFFFFF;">

Edit: More evidence that this should work. Is there a different regex parser in use between .sublime-snippet and .tmLanguage ?

Edit 2: Revised my regex a bit, seems to do the trick. Still curious about this error though.
Code: Select all
\b([a-zA-Z\-:]+)\s*=\s*((["']?).*?(\3))
nick.
 
Posts: 266
Joined: Wed Jan 18, 2012 3:45 am

Re: Regex support -- doesn't ST2 use the Boost library?

Postby jps on Sat Apr 07, 2012 4:08 am

.tmLanguage files use the Oniguruma regex library, while the Find panel and snippets use boost regex.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Regex support -- doesn't ST2 use the Boost library?

Postby nick. on Sat Apr 07, 2012 4:45 am

Thanks for the reply Jon. I'll dig into that API to see what the differences are.
nick.
 
Posts: 266
Joined: Wed Jan 18, 2012 3:45 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 26 guests