JGCSCS 4 Delphi & Pascal *.pas;*.dpr;*.dfm;*.xfm;*.nfm JGsoft support@editpadpro.com http://www.editpadpro.com http://www.borland.com/delphi/ TRUE // 1 Delphi source code and form files; Pascal source code 6 {$DEFINE DIRECTIVE} // comment procedure Test(X: Integer); begin Number := 1234; S := 'abcdef'; end; 0 FALSE 12 Reserved words \b(?:absolute|abstract|and|array|asm?|assembler|automated|begin|case|cdecl|class|const(?:ructor)?|deprecated|destructor|dispid|dispinterface|div|do(?:wnto)?|dynamic|else|end|except|exports?|external|far|file|finalization|finally|for(?:ward)?|function|goto|if|implementation|in(?:herited|itialization|line|terface)?|is|label|library|message|mod|near|nil|not|object|of|on|or|out|overload|override|packed|pascal|platform|private|procedure|program|protected|public|published|raise|record|register|reintroduce|repeat|resourcestring|safecall|set|shl|shr|stdcall|strict|string|then|threadvar|to|try|type|unit|until|uses|var|virtual|while|with|xor)\b TRUE FALSE 7 0 0 FALSE Property \bproperty\b TRUE FALSE 7 0 3 FALSE Integer or float \b[0-9]++(?:\.[0-9]++)?(?:E[+-]?[0-9]++)?\b TRUE FALSE 10 0 0 FALSE Hexadecimal number \$[A-F0-9]++\b TRUE FALSE 10 0 0 FALSE Single-line comment //.*+ FALSE FALSE 5 0 0 TRUE Compiler directive Closing } optional so an unclosed directive is colored until the end of the file {\$[^}]*+}? FALSE FALSE 11 0 0 FALSE Multi-line comment Closing } optional so an unclosed comment is colored until the end of the file {[^}]*+}? FALSE FALSE 5 0 0 TRUE Multi-line comment We use a toggle subscheme to find the closing tag for performance reasons, since we cannot use a possessive negated character class to skip over the commented text \(\* FALSE FALSE 5 0 4 FALSE Brackets [()]++ FALSE FALSE 17 0 0 FALSE Operator Since // starts a single line comment, we must not match more than one operator character at the same time (i.e. no quantifier in the regex) [-+*/:@^<>=] FALSE FALSE 13 0 0 FALSE String Closing ' optional so unclosed strings are colored until the end of the line '[^'\r\n]*+'? FALSE FALSE 9 0 0 TRUE Character #(?:\$[A-F0-9]++|[0-9]++)\b TRUE FALSE 9 0 0 FALSE 5 (* *) FALSE 5 ( ) TRUE 3 [ ] TRUE 3 { } FALSE 2 ' ' FALSE 2 2 Property 1 0 FALSE 2 Reserved words These words are only reserved in property definitions \b(?:read|write|index|default|nodefault|string|array)\b TRUE FALSE 7 0 0 FALSE End of property definition ; FALSE FALSE 0 0 2 FALSE (*Comment*) 1 5 TRUE 1 Closing *) \*\) FALSE FALSE 5 0 2 FALSE