Question: this is using regular expressions Problems (50 points) Lecture 7: Regular Expressions, part 2 1. 3 points) Write a regular expression for the language over

 this is using regular expressions Problems (50 points) Lecture 7: Regular this is using regular expressions

Problems (50 points) Lecture 7: Regular Expressions, part 2 1. 3 points) Write a regular expression for the language over a's and b's where the strings have an even number of a's or an even number of b's 2. (6 points) Write a regular expression for comments of the form /...../ (1) The comment begins with / and end with the first / encountered. (2) Optional whitespace can precede the comment or follow the comment, but nothing else. Whitespace consists of spaces and or tabs (\t). Don't include newline ( . (3) The text of the comments can include letters or digits, space, tab, underscore, and / (4) The comment can include /*. but we don't nest comments. (5) The star of the beginning /* cannot be the star of the ending /. (6) The symbol before the ending */ doesn't have to be whitespace. (7) Inside a regular expression, if you want a star symbol, escape it as \since just means Kleene star. (So within the expression, write to mean a slash followed by a star. As an expression, just/ means zero or more slashes Some strings that should fail to match: /* xyz */ */ / /* xyz / / By rules 1 and 2 By rules 1.2 and 4 By rule 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!