Home Download Buy Blog Forum Support

How to ignore case when doing matching in language syntax

How to ignore case when doing matching in language syntax

Postby Adagioklez on Mon Mar 14, 2011 3:06 pm

This is a subpart of my language definition that I'm currently working, however I would like to know if I in some way can force the matching to ignore case?

{ "match": "(dcl|DCL)(\\s*)([A-Za-z0-9_]*)(\\s*)(.*)(;)",
"name": "variable.definition.pli",
"captures": {
"1": { "name": "keyword.source.pli" },
"3": { "name": "variable.parameter.pli" },
"5": { "name": "keyword.source.pli" }
},
"comment": "Markup of dcl statements"
},

According to http://manual.macromates.com/en/regular_expressions there is some extended group, however I'm not sure how to activate it.
Looking forward to hear from you guys.

Thanks Stefan
Adagioklez
 
Posts: 15
Joined: Fri Feb 25, 2011 1:03 pm

Re: How to ignore case when doing matching in language syntax

Postby adzenith on Mon Mar 14, 2011 4:16 pm

You just put (?i) at the beginning to turn on case insensitive mode. You can use (?-i) to turn it back off.
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 26 guests