Title |
Test
Find
Javascript Tokenizer
|
Expression |
(\/\*[\s\S.]+?\*\/|[/]{2,}.*|\/((\\\/)|.??)*\/[gim]{0,3}|'((\\\')|.??)*'|"((\\\")|.??)*"|-?\d+\.\d+e?-?e?\d*|-?\.\d+e-?\d+|\w+|[\[\]\(\)\{\}:=;"'\-&!|+,.\/*]) |
Description |
Tokenize a Javascript document for parsing
each token is a language-token : string, int, float, comment, multiline comment, operator, expression etc. etc. |
Matches |
var a = 12.5 * 5 + 3e9;var b = "str'\"ing";var c = 'str"\'ing';var d = /regex/gi;var e = Func(); |
Non-Matches |
spaces/newline/tab |
Author |
Rating:
Martin Kirk
|
Source |
(\/\*[\s\S.]+?\*\/|[/]{2,}.*|\/((\\\/)|.??)*\/[gim]{0,3}|'((\\\')|.??)*'|"((\\\")|.??)*"|-?\d+\.\d+e?-?e?\d*|-?\.\d+e-?\d+|\w+|[\[\]\(\)\{\}:=;"'\-&!| |
Your Rating |
|
Title: Fails on certain identifiers
Name: Takuan
Date: 6/19/2008 12:16:19 PM
Comment:
Fails to recognize '$' as a valid character in a javascript identifier, which can be important because some of the most common js frameworks and libraries (like jQuery) make extensive use of this.
You can easily verify this by testing the following text:
$(oldElement).appendTo(form);