To Ooooooooo c
To Ooooooooo c
MODULE -1
Define Deterministic Finite Automata. Explain the two
preferred
notations for describing the Transition Function with an
example.
Draw a DFA to accept decimal strings divisible by 3
Module-2
Pumping lemma
Applications of Regular Expressions (RE):
1.Text Searching and Matching: Used to search specific patterns in
text files.
2.Input Validation: Validate inputs like email addresses, phone
numbers, and passwords.
3.Syntax Highlighting: Enable editors to identify and colorize
programming syntax.
4.Data Extraction: Extract data like URLs, dates, or other patterns
from text files.
5.String Replacement: Modify or replace text in files (e.g., sed, awk in
UNIX).
6.Log Analysis: Analyze log files for specific patterns (e.g., error
codes).
7.Compiler Design: Token recognition in lexical analysis.
8.Configuration Parsing: Recognize and extract configuration
directives from files.
Notations Used in UNIX for Regular Expressions:
1.^: Matches the start of a line.
2.$: Matches the end of a line.
3..: Matches any single character except a newline.
4.*: Matches zero or more occurrences of the preceding character.
5.[]: Denotes a set of characters; matches any one character within the brackets.
6.[^]: Matches any character not in the set.
7.\: Escape character for special characters.
8.|: Alternation; acts like an OR operator.
9.(): Groups expressions for capturing or precedence.
+:
10. Matches one or more occurrences of the preceding character.
?: Matches zero or one occurrence of the preceding character
11.
Examples of Regular Expressions with UNIX Notations:
These expressions are widely used in UNIX commands like grep, sed, and awk to manipulate and analyze text data effectively.