JGCSCS 4 JavaScript & ECMAScript *.js JGsoft support@editpadpro.com http://www.editpadpro.com/cscs.html TRUE // 0 5 // comment function Test() { Number = 1234; String = 'abcdef'; Regex = /regex/; } 0 FALSE 11 Single-line comment //.*+ FALSE FALSE 5 0 0 TRUE Multi-line comment /\* FALSE TRUE 5 0 3 FALSE Bracket [{}]++ FALSE FALSE 17 0 0 FALSE String Closing quote optional so an unclosed string is still colored as a string "[^"\\\r\n]*+(?:\\(?:.|$)[^"\\\r\n]*+)*+"? FALSE FALSE 9 0 0 TRUE Character Closing quote optional so an unclosed string is still colored as a string '[^'\\\r\n]*+(?:\\(?:.|$)[^'\\\r\n]*+)*+'? FALSE FALSE 9 0 0 FALSE Hexadecimal number \b0x[0-9A-F]++\b TRUE FALSE 10 0 0 FALSE Integer or float \b[0-9]++(\.[0-9]+)?(E[+-]?+[0-9]++)?\b TRUE FALSE 10 0 0 FALSE Reserved words \b(?:abstract|boolean|break|byte|case|catch|char|class|const|continue|debugger|default|delete|do(?:uble)?|else|enum|export|extends|false|final(?:ly)?|float|for|function|goto|if|implements|import|in(?:stanceof|t(?:erface)?)?|long|native|new|null|package|private|protected|public|return|short|static|super|switch|synchronized|this|throws?|transient|true|try|typeof|var|void|volatile|while|with)\b FALSE FALSE 7 0 -1 FALSE Regex A / that is preceded by a ( or = starts a regular expression. The next unescaped / terminates the regex. (?<=[(=]\s*)/[^/\\\r\n]*+(?:\\.[^/\\\r\n]*+)*+/? FALSE FALSE 19 0 0 FALSE Operator [-+*/=<>%&^|!~?[\]]++ FALSE FALSE 13 0 0 FALSE Round brackets We cannot merge these with the Operator element, because then Operator will match "(/" in "match(/regex/)" and then the regex can no longer be matched [()]++ FALSE FALSE 13 0 0 FALSE 7 { } TRUE 3 ( ) TRUE 3 [ ] TRUE 3 /* */ FALSE 2 / / FALSE 2 ' ' FALSE 2 " " FALSE 2 1 Multi-line comment 1 5 TRUE 1 Closing */ \*/ FALSE FALSE 5 0 2 FALSE