|
|
|
|
|
by unlinkr
2474 days ago
|
|
So how would you tokenize without the use of regular expressions? What more appropriate technique would you use instead? The example you provide in not XHTML so not really relevant for the discussion. But in any case, a regular expression have no problem recognizing a quoted string. |
|
Since this need doesn't appear to be an everyday one, with clearly defined targets, a simple hand-written lexer isn't hard to write, and will make less mistakes than a regex. Just use a scanning approach. As a bonus, you'll still be able to read in 12 months time.