Sublime Forum

Two wrong regexes in the Javascript syntax file

#1

I’ve parsed the javascript syntax file in order to get all regexes but these two gave me errors

keyword.operator.js

/!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|(?<!\()/=|%=|\+=|\-=|&=|\^=|\b(in|instanceof|new|delete|typeof|void)\b/gm

the wrong bits are: (?<!()/ and I changed it to (?<!()/

support.constant.js

/(?<=\.) ................... \b/gm

the error is in the first group: (?<=.) changed to (.)

I can’t understand whats the meaning of these two groups, maybe they are not in js regex syntax. :question:

0 Likes

#2

Those are both correct regex forms.
(?<!stuff) is a negative look-behind assertion, which requires that the preceding text is not what is specified in the parens
(?<=stuff) is a positive look-behind assertion, which requires that the preceding text is what is specified in the parens

0 Likes

#3

Thanks for the info it looks like this construct is not supported in javascript.

0 Likes