Home Download Buy Blog Forum Support

Two wrong regexes in the Javascript syntax file

Two wrong regexes in the Javascript syntax file

Postby k0ren on Tue Jul 10, 2012 11:59 pm

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

keyword.operator.js
Code: Select all
/!|\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|(?<!\()/=|%=|\+=|\-=|&=|\^=|\b(in|instanceof|new|delete|typeof|void)\b/gm

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

support.constant.js
Code: Select all
/(?<=\.) ................... \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. :?:
k0ren
 
Posts: 4
Joined: Mon Jun 25, 2012 12:33 pm

Re: Two wrong regexes in the Javascript syntax file

Postby adzenith on Wed Jul 11, 2012 12:24 am

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
adzenith
 
Posts: 1217
Joined: Mon Oct 19, 2009 9:12 pm

Re: Two wrong regexes in the Javascript syntax file

Postby k0ren on Wed Jul 11, 2012 9:48 am

Thanks for the info it looks like this construct is not supported in javascript.
k0ren
 
Posts: 4
Joined: Mon Jun 25, 2012 12:33 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 26 guests