How to select the regex that matches the first token of a string?

user1234 user1234 at 12.de
Sat Jul 3 09:28:32 UTC 2021


On Saturday, 3 July 2021 at 09:05:28 UTC, vnr wrote:
> Hello,
>
> I am trying to make a small generic lexer that bases its token 
> analysis on regular expressions. The principle I have in mind 
> is to define a token type table with its corresponding regular 
> expression, here is the code I currently have:
>
> [...]

storing the regex in a token is an antipattern.


More information about the Digitalmars-d-learn mailing list