Question
Note: The below regular expressions should utilize metacharacters, character classes, grouping, alternation, and quantifiers where applicable. Also, when creating your regular expressions, please use the
Note: The below regular expressions should utilize metacharacters, character classes, grouping, alternation, and quantifiers where applicable. Also, when creating your regular expressions, please use the notation from the lectures: /regular expression/
1. Write a regular expression that matches your name
2. Write a regular expression that matches the words Then and Than (use a character class)
3. Write a regular expression that matches the sequence yes or the sequence no
4. Write a regular expression that matches at least one d followed by any number of f's.
5. Write a regular expression that matches the structure of a social security number
6. Write a regular expression that matches all names that begin with a Mc (case sensitive)
7. Write a regular expression that will match all C++ files (files/names that end in a .c or .cc., dont worry about cpp)
8. Write a regular expression that matches words that contain a sequence of vowels (aeiou) (e.g. jjjakkkollllu, akkkku, jallekkillllu)
9. Write a regular expression that matches words that begin and end with the letter b (e.g bob, bulb, etc)
10. For the below regular expression, give two examples that match the expression and two examples that do not match. Your examples that match and do not match the expression must include the characters x and y. The entire character set is x and y.
/x+y+/
11. For the below regular expression, give two examples that match the expression and two examples that do not match.
/[a-f]z?/
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started