Question

Given the regular expression: ^[ABC][^AB]$ find all the matching patterns (could be more than one): a)...

Given the regular expression: ^[ABC][^AB]$ find all the matching patterns (could be more than one):

a) A

b) AB

c) ADBC

d) D

e) None

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

^ : Starting position in a string.

[] : Matches a single character that is contained within the brackets

^[ABC] : Starting position should contain 'A' or 'B' or 'C'

[^ ] : Matches a single character that is not within the characters contained in brackets

$: Matches ending position of string

[^AB]$ : Ending position of character should not be in 'A' or 'B'

Hence

A is not a match because reg exp requires 2 characters

D is also eliminated

ADBC is also because required length is 2

AB is not a valid match because last character hould not be in A or B

Hence the answer is None

Add a comment
Know the answer?
Add Answer to:
Given the regular expression: ^[ABC][^AB]$ find all the matching patterns (could be more than one): a)...
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