Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to enable the shortest match rule in flex (lexer)?

By default flex uses the longest match rule. Is there any way to override this behavior to make it match the shortest sequence?

Thank you

like image 216
VilleDePommes Avatar asked Nov 30 '11 20:11

VilleDePommes


1 Answers

This page in the Flex manual says that it doesn't have any non-greedy operators because it is a scanner rather than a parser, and suggests regular expressions could be used to add the missing functionality.

like image 102
Matthew Strawbridge Avatar answered Nov 11 '22 14:11

Matthew Strawbridge