| Regular Expression | String, length 5 which matches | String, length 5 which does NOT match |
| 0*((0|1|2) *|(22) *) * |
• 00000 • 011222 • 121212 |
Impossible. All possible 5 length string is generated |
| (0|2) *1(2|0) * |
•00100 •20120 |
• 20121 11201 |
| 0(1|2) *0 |
• 01210 •02220 |
•11111 •00011 |
| 01(0*) (2101) * |
• 01000 This is the only possible string of length 5 |
•02101 |
In first question 0*((0|1|2) *|(22) ) * -> This language
produces all string possible of all length. Thus it has language of
*. Produces all possible string.
If you have any questions comment down and please upvote thanks??
Question 6 10 pts For each regular expression below, fill in the table with an expression...
Using Regular Expression. 1. Write the regular expression that matches any string that ends with a capital letter. 2. Write the regular expression that matches any string that begins with a digit, ends with a digit, and has AT MOST only one digit in the middle of the string. (* means zero or more of preceding, +means one or more and ? means 0 or 1 (we did not look at the ? in class)) So your answer should match...
4. Write regular expressions that match the descriptions given below. (10 P Description A sequence of digits of any length that also contains the sequence of four letters "meow", in that order, anywhere in the Expression sequence. A sequence of zero or more x's and y's, OR zero or one z's. 3 The American word color, or the British spelling (colour). Your answer can NOT include an or. 4 A string that begins with an X and ends with an...
Regular Expression processor in Java Overview: Create a Java program that will accept a regular expression and a filename for a text file. The program will process the file, looking at every line to find matches for the regular expression and display them. Regular Expression Format The following operators are required to be accepted: + - one or more of the following character (no groups) * - zero or more of the following character (no groups) [] – no negation,...
(4) [20 pts] Let L be the language defined by a regular expression (O | 1)0+(01 1)). over t alphabet f(o,1, +) (a) (4pt) Write down 5 different words from L (b) (8pt) Describe L using words. (c) (8pt) Draw an automaton accepting L (ideally, deterministic).
(4) [20 pts] Let L be the language defined by a regular expression (O | 1)0+(01 1)). over t alphabet f(o,1, +) (a) (4pt) Write down 5 different words from L (b) (8pt) Describe...
JAVA
(10 points; 2 points each part) For each method call in the table below, determine which of the methods on the top table is actually called, or indicate that it is impossible because there is either no method that matches, there are several methods that match, or something else has gone wrong. 2. MethodMethod Signature Identifier void concatenate (int subject, String operation, int object) int concatenate(double subject, String operation, double object) double concatenate(double subject, String operation, double object) int...
Part II: Regular Expression 1. Chose match(es) for each given basic/extended regular expression (maybe multiple correct matches) and describe the pattern of matched string for 3), 4), 5),6), 11) e.g. (ab+a, (extended regex ) a) ababa b) aba c)abba d)aabba e)aa Answer: b,c; Pattern : The matched string should begin and end with 'a and ‘b' occurs at least once between leading and ending ‘a') ote: 1) to 5)are basic regexes 1) 'a[ab]*a' (a)ababa (b) aaba (c) aabab (d) aabbaa...
For each problem below (except #8), show a regular expression representing the described set. The set of strings over {c, l, e, a, n} with length less than 5. The set of strings over {c, l, e, a, n} with length greater than 7 If you take the union of the regular expressions from the previous two problems, how many strings more does the corresponding set need to contain all of Σ* , where Σ = {c, l, e, a,...
Preliminaries For this lab you will be working with regular expressions in Python. Various functions for working with regular expressions are available in the re module. Fortunately, Python makes it pretty easy to check if a string matches a particular pattern. At the top of the file we must import the re module: import re Then we can use the search() function to test whether a string matches a pattern. In the example below, the regular expression has been saved...
(18 pts) Fill in the blanks in the table below (Use the midpoint formula to compute elas ticity values ) and finish the last two questions based on the table. (a) (14 pts) Fill in the blanks in the table below Price Quantity demanded Total Percent Change Percentage Change Price Elasticity Revenue in Price (%) in Quantity (%) (Absolute Value) 1 18 200 -22.2 0 13.3 22.2 -40 18 15.4 -200 (b) (2 pts) When the elasticity ép > 1:...
Question 1 Complete the following reaction equations. Fill the table below. (25 pts) NaCN M.N с COOH AICI, LAIHO--but) 2 Page Section 01