Question

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...

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.

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

The first Regular expression:

[A-Z][0-9]{6} -> It matches a string whose first character is a capital letter from A to Z , followed by 6 digits.

eg. A123456

The finite state machine (NFA) is given below:

The second regular expression.

\d+([A-Z][a-z]+)+\n([A-Z][a-z]+)+,[A-Z]{2} \d{5}\ -> It matches a string starting with atleast one digit, then it has a group one or more times, which contains one capital letter followed by one or more small letters. The string then must have a newline symbol . Then it has another group with properties exactly same as previous group. A comma is there after that. Then there are two capital letter, followed by 5 digits .

The finite state machine (NFA) is given below:

Add a comment
Know the answer?
Add Answer to:
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...
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