**************Regular Expressions ( Regex Syntax) answer all the multiple choice questions.*************

Question 1

Consider the following regular expression:

0[1-9]|1[0-2]

Which of the following strings does NOT match? A.)

00 B.)

01 C.)

10 D.)

12

Question 2

Consider the following regular expression (from the previous question):

0[1-9]|1[0-2]

What type of string does this expression validate?

A.

Any 2 digits.

B.

A 2-digit representation of the year.

C.

A 2-digit representation of the month.

D.

A 2-digit representation of the day.

Question 3

Which regular expression best matches a 2-character representation of a state abbreviation requiring uppercase letters?

A.

[A-Z][A-Z]

B.

[A-Z|a-z][A-Z|a-z]

C.

DD

D.

ww

Question 4

Which regular expression best matches the representation of time using a 24-hour clock, e.g. military or computer time?

A.

/d/d:/d/d

B.

^([0-1][0-9]|2[0-3])[:][0-5][0-9]$

C.

^[0-2]?[0-9]:[0-5][0-9]$

D.

/d?/d:/d/d

5 points

Question 5

Which regular expression best matches an asu email address?

A.

w+@asu.edu

B.

w+@asu.edu

C.

w*@asu.edu

D.

W+@asu.edu

5 points

Question 6

Which regular expression best matches a 10-digit phone number with or without dashes?

A.

d+

B.

dddddddddd

C.

d+-?d+?d+

D.

ddd-?ddd-?dddd

Question 7

There is an additional meta-character in regular expressions {n},
which means to match the preceding character n times exactly.
For example, a 3-digit number can be matched by [0-9]{3}.

Which of the following regular expressions best matches a 16 digit credit card number?

A.

ddddddddddddddd

B.

D{16}

C.

d{16}

D.

d[16]

Question 8

Note that the syntax {n,m} matchese the preceding character at least n times but not more than m times.
Which of the following regular expressions best matches an ip address?

A.

d{3}.d{3}.d{3}.d{3}

B.

d{1,3}.d{1,3}.d{1,3}.d{1,3}

C.

d{1,3}.d{1,3}.d{1,3}

D.

d{1,3}.d{1,3}.d{1,3}.d{1,3}

  

Question 9

Which of the following regular expressions best determines whether a password consists of alphanumeric characters and is at least 6 in length but no longer than 12?

A.

w{6,12}

B.

w[6,12]

C.

W{6,12}

D.

W[6,12]

"Get 15% discount on your first 3 orders with us"
Use the following coupon
"FIRST15"

Order Now