Flex (Fast Lexical Analyzer Generator) is a tool for generating programs that recognize patterns in text. It allows for the versatility to specify the rules for pattern-finding, eradicating the need to develop a specialized program.
Flex is a free software alternative to the classic lex tool. It generates C source code for scanners that can recognize regular expressions. The generated scanners are highly efficient and suitable for use in a wide variety of applications, from simple text processing to complex lexical analysis in compilers.
Comprehensive documentation is installed in /usr/share/doc/flex-2.6.4/ including:
Flex maintains compatibility with the original lex tool while providing many enhancements and improvements. Programs that expect lex can use the provided lex symbolic link.