.
4. String: qwqwqwqX
but according to RE, string can have multiple combination of 'qw'
taken together, not seperately, so the 'q' before X is not
possible.
5. there should be few characters before y.
6. there should be atleast do digits in the string, first digit
(from 1 to 9) and seconddigit (from 0 to 9)
7. String: Xpp
the seconnd character should have been in Upper Case.
8- string: 0valpha-bet3
The string can not have '-'. because it is not present in RE
9- String: runAway
after any upper case leter, only 'ay'is possible.
but here after 'A' way is present.
10 - string: m-defg
The string can only start with any character between a and c, i.e,
"a", "b", "c"
If there is anything that you do not understand, then please mention it in the comments section.
For each of the following pairs of regular expressions and strings, indicate the reason that the...
1. For each of the following regular expressions find a language (i.e., a set of strings) over A = {a,b,c} that can be represented/described by that expression. (6 points) a. bac + bc b. b*ac + bc C. b*ccca* a. 2. Find a regular expression to describe the given language: {b, ac, bac, bc, ..., b”ac, bc”, ... } (3 points)
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...
DO NUMBER 4 AND 5
2. Let {acgt} and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg, gc. Construct both a DFSM to accept the language and a regular expression that represents the language 3. Let a,b. For a string w E X", let W denote the string w with the a's and b's flipped. For example, for w aabbab: w bbaaba wR babbaa abaabb {wwR Construct a PDA to accept...
DO NUMBER 3
2. Let {acgt} and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg, gc. Construct both a DFSM to accept the language and a regular expression that represents the language 3. Let a,b. For a string w E X", let W denote the string w with the a's and b's flipped. For example, for w aabbab: w bbaaba wR babbaa abaabb {wwR Construct a PDA to accept the language:...
please Answer the following regular expressions questions(also do number 9) Q4 Choose the pattern that finds all filenames in which the first letters of the filename are astA, followed by a digit, followed by the file extension .txt. 1) astA[[:digit:]]\.txt 2) astA[[0-9]].txt 3) astA.\.txt 4) astA[[:digit:]].txt Q5 What's the difference between [0-z]+ and \w+ ? 1) The first one accepts 0 and z and the other doesn't. 2) The first one doesn't allow for uppercase letters. 3) The first one...
Create a python add the following functions below to the module. Each section below is a function that you must implement, make sure the function's names and parameters match the documentation (Copy-Paste). DO NOT put the functions in an if-name-main block. 1. def productSum(x: int, y: int, z: int) -> int This function should return: The product of x and y, if the product of x and y is less than z. Else it should return the sum of x...