Lex is a computer program that generates lexical analyzers and was written by Mike Lesk and Eric Schmidt.
Lex reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in the C programming language.
Prerequisite: Flex (Fast lexical Analyzer Generator)
The extraction is based on the way tags are written in HTML. All tags are included in < >. This will set the rule to extract the HTML tags from the given input file.
Input File: tags.txt
Below is the implementation to extract HTML tags from file:
- Lex code to replace a word with another word in a file
- Lex program to copy the content of one file to another file
- C program to copy contents of one file to another file
- Self Destructing Code in C
- Basic Code Optimizations in C
- Writing OS Independent Code in C/C++
- Code valid in both C and C++ but produce different output
- Convert C/C++ program to Preprocessor code
- Code to generate the map of India (with explanation)
- Printing source code of a C program itself
- How to write a running C code without main()?
- Convert C/C++ code to assembly language
- DFA in LEX code which accepts strings ending with 11
- Lex code to count total number of tokens
- C++: Methods of code shortening in competitive programming
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : nidhi_biet