Which of the following
strings would match the regular expression:
[a-z]+[\.\?!]
A. Shout!
B. Cry
C. weep.?
D. Laugh
E. smile?
What is the answer and why. go through each expression please. eg what does\. do \?! do etc
Which of the following strings would match the regular expression:
[a-z]+[\.\?!]
Answer: (E) smile?
Description:
• In given regular expression, [a-z] means "a character from a through z"
• [a-z]+ means "[a-z] one or more time"
• \. indicates Special use of the " . " symbol.
• \? indicates Special use of the " ? " symbol.
• [\.\?!] means "." or "?" or "!"
Strings that will match the expression:
(E) smile? → Match
Description:
In "smile?" string, "smile" matches the [a-z]+ form and "?" matches the "\?" form. So, the string "smile?" matches the [a-z]+[\.\?!] regular expression.
Strings that will not match the expression:
(A) Shout! → Not Match
Description:
In "Shout!" string, 'S' would not match the [a-z]+ form. So, the string "Shout!" does not matches [a-z]+[\.\?!] regular expression.
(B) Cry → Not Match
Description:
In "Cry" string, 'C' would not match the [a-z]+ form. So, the string "Cry" does not matches [a-z]+[\.\?!] regular expression.
(C) weep.? → Not Match
Description:
In "weep.?" string, the character "." and "?" both are there which would not match the [\.\?!] form. So, the string "weep.?" does not matches [a-z]+[\.\?!] regular expression.
(D) Laugh → Not Match
Description:
In "Laugh" string, 'L' would not match the [a-z]+ form. So, the string "Laugh" does not matches [a-z]+[\.\?!] regular expression.
Which of the following strings would match the regular expression: [a-z]+[\.\?!] A. Shout! B. Cry C....
Please Explain, Thanks :)
QUESTION 2 Consider the regular expression (a+b)'(cd)b Which of the following strings is a part of the regular expression ? O abacd O abababcb O abababc
roblem 18 [15 points Consider the Turing M (Q,E, T,6,4, F), such that 16 g transition set (d) Write a regular expresion that defitves L. fsuch a regular expression does mot exist, prove it Answer: E, N,t,1, R (M has an one-way infinite tape (infinite to the right only.) B is the designated blank symbol. M accepts by final state.) Let L be the set of strings which M accepts Let LR be the set of strings which M rejects....
3) Construct a regular expression defining each of the following languages over the alphabet {a, b}. (a) L = {aab, ba, bb, baab}; (b) The language of all strings containing exactly two b's. (c) The language of all strings containing at least one a and at least one b. (d) The language of all strings that do not end with ba. (e) The language of all strings that do not containing the substring bb. (f) The language of all strings...
Describe in plain english what the following regular expressions match: ab+c [A-Z][0-9]{6} \d+ ([A-Z][a-z]+)+\n([A-Z][a-z]+)+,[A-Z]{2} \d{5}\ Write a finite state machine for each of the previous regexs.
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...
4. Match which analysis would go with each situation. You will not use all choices! (3 pts.) Test whether a majority of Americans A. ANOVA are satisfied with government handling of Coronavirus B. t test for two means Compare prices of textbooks for online vendor vs. C. Chi-square test campus bookstore rental program D. One sample z test Determine if there is a relationship between dog breed E. Regression and whether or not the dog gets a particular disease GO...
Which of the following is an equivalent Boolean expression to AB+B'+B? a) AB+B’ b) B’B c) AB d) A e) None of the above Please explain your answer
Problem 6. The Marginal Benefit of hiring workers for a firm is given by the expression: MB 3,500 X. The Marginal Cost to the firm of hiring workers is approximately given by the expression: MC = 5000.01X~. Please calculate the optimal amount of workers that the organization a. should hire. Draw a diagram of the solution b. Briefly explain the slopes of the Marginal Benefit and Marginal Cost Curves. Why does it cost more to hire each additional worker? Why...
Quiz 10 1. (2 points) Which of the following conditions would lead to the highest levels of lac operon expression? a) High lactose, high glucose b) High lactose, low glucose c) Low lactose, high glucose d) Low lactose, low glucose e) None of the above would have any lac operon expression 2. (2 points) Which of the following is true concerning molecular genetics? a) tRNA carries amino acids into the nucleus in eukaryotic cells b) DNA polymerase moves towards the...
1.Dividend payments* In 2017, Entergy paid a regular quarterly dividend of $.89 per share. a. Match each of the following dates. (AI) Friday, October 27 (BI) Record date (A2) Tuesday, November 7 (A3) Wednesday, November 8 (A4) Thursday, November 9 (A5) Friday, December 1 (B2) Payment date (B3) Ex-dividend date (B4) Last with-dividend date (B5) Declaration date b. On one of these dates, the stock price fell by about $.89. Which date? Why? c. Entergy's stock price in November 2017...