Problem: Write a Lex Program to check valid Mobile Number.
FLEX (Fast Lexical Analyzer Generator) is a tool/computer program for generating lexical analyzers (scanners or lexers) written by Vern Paxson in C around 1987. Lex reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer in the C programming language. The function yylex() is the main flex function which runs the Rule Section.
Input: 7017175023 Output: Mobile Number Valid Input: 0001112223 Output: Mobile Number Invalid
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Lex program to check if a Date is valid or not
- Lex Program to check valid email
- Lex Program For checking a valid URL
- Lex Program to accept a valid integer and float value
- Lex program to check whether given number is armstrong number or not
- Lex program to check whether a given number is even or odd
- Lex program to check whether input number is odd or even
- Lex Program to check whether a number is Prime or Not
- YACC program to implement a Calculator and recognize a valid Arithmetic expression
- Lex program to recognize valid arithmetic expression and identify the identifiers and operators
- Lex program to check whether given string is Palindrome or Not
- C program to check syntax of 'for' loop
- Lex program to check perfect numbers
- Lex program to check whether the input is digit or not
- YACC program to check whether given string is Palindrome or not
- Lex Program to count number of words
- Lex program to check whether an year is a leap year or not
- Lex program to count the number of lines, spaces and tabs
- LEX program to count the number of vowels and consonants in a given string
- C program to detect tokens in a C program
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.