Question: 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

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 accepts more punctuation characters than the second one. 4) Nothing. They're identical. Q6 What does the regular expression (\d{1,2}\/\d{1,2}\/\d{4} most likely represent? 1) An American ZIP code 2) A date 3) A phone number 4) A price Q7 What does the regular expression [a-zA-Z0-9_]{3,14} most likely represent? 1) An e-mail address 2) A street address 3) A username 4) A set of X and Y coordinates Q8 What does the regular expression ^((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))$|^([01]\d|2[0-3])(:[0-5]\d){0,2}$ most likely represent? 1) A street address 2) A name 3) A time 4) A date Q9 The regular expression ^\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \d[A-Z]\d$ is designed to validate American ZIP Codes and Canadian Postal Codes but there are two problems with it. What is one of the flaws? 1) It doesn't allow for leaving the space out after the third character in the Canadian Postal Code. 2) American ZIP codes that start with 0 aren't accepted. 3) It requires that the string contain an American ZIP Code followed by a Canadian Postal Code. 4) It allows for American ZIP codes with 9 digits. Q10 What does the regular expression ^([0-3]|[0-9][0-9]|4[0-5][0-9]|46[0-6])$ most likely represent? 1) A range of numeric values from 0 to 499. 2) A range of numeric values from 399 to 499. 3) A range of numeric values from 399 to 466 4) A range of numeric values from 0 to 466.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!