Question

For each of the following pairs of regular expressions and strings, indicate the reason that the string does not match the regular expression Regular Expression String Reason for mismatch AbCdEfG AbCdefG [A-Z][a-zl*! CamelCase! Abc\.def Abcxdef 4 qwqwqwqX 6.I-11-90-9) [A-Z][A-Zlla-z] Xpp 8 Ovla-ZA-ZO-9]+ Ovalpha-bet3 [aeiou][a-z]*[A-Z]ayrunAway 10. [a-c-((de)l(fg))? m-defg

0 0
Add a comment Improve this question Transcribed image text
Answer #1

.

  1. The expression does not contain e, but in String 'e' is present.
  2. String: CamelCase! but according to RE, we will not get any Upper-case letter, after the First letter(which is UPPER case), which is 'C' of 'Case'
  3. RE: Abc\.def String: Abcxdef, there is no "x" possible from the Given RE.

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.

Add a comment
Know the answer?
Add Answer to:
For each of the following pairs of regular expressions and strings, indicate the reason that the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT