Hi!
https://bugs.eclipse.org/bugs/show_bug.cgi?id=404832- JavaScript error
on valid regex
The issue has patch attached (that was updated on August 22) that fixes
almost all problems with RegEx using in JavaScripts (we've tested it on
most known and used scripts like jQuery Minified).
The Issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=326449 (parser
error on regular expression containing sequence [/]) recently pushed
into 3.5.1 doesn't fixes all the RegEx problems.
See how it works on the examples provided in Bug 404832:
Example 1:
var test = { email :
/^(")?(?:[^\."])(?:(?:[\.])?(?:[\w\-!#$%&'*+/=?^_`{|}~]))*\1@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/}
Example 2:
lexer.rules =
[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}
]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:\s+)/,/^(?:[a-zA-Z0-9_$-/]+)/,/^(?:$)/];
It would be great if the patch for 404832 will be also pushed into 3.5.1
because it covers much more issues with RegEx.
Bugs in RegEx validation and scanning (try to add expression from
example 2 to the end of your script or copy/paste it into a new script,
set the text cursor at the end of the line and press Enter - you'll see
what will happen because of wrong scan) are really annoying when you try
to develop a JavaScript projects.
Thanks,
Victor Rubezhny
Exadel, Inc.
_______________________________________________
wtp-dev mailing list
wtp-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/wtp-dev