Py4e: Chapter 11- Questions and Answers|
Latest Update
What is the type of the return value of the re.findall() method? A list of strings
What is the "wild card" character in a regular expression (i.e., the character that matches any
character)? .
What is the difference between the "+" and "*" character in regular expressions? The "+"
matches at least one character and the "*" matches zero or more characters
What does the "[0-9]+" match in a regular expression? One or more digits
What does the following Python sequence print out?
x = 'From: Using the : character'
y = re.findall('^F.+:', x)
print(y) not From: or :
What character do you add to the "+" or "*" to indicate that the match is to be done in a non-
greedy manner? ?
Given the following line of text:
From Sat Jan 5 09:14:16 2008
Latest Update
What is the type of the return value of the re.findall() method? A list of strings
What is the "wild card" character in a regular expression (i.e., the character that matches any
character)? .
What is the difference between the "+" and "*" character in regular expressions? The "+"
matches at least one character and the "*" matches zero or more characters
What does the "[0-9]+" match in a regular expression? One or more digits
What does the following Python sequence print out?
x = 'From: Using the : character'
y = re.findall('^F.+:', x)
print(y) not From: or :
What character do you add to the "+" or "*" to indicate that the match is to be done in a non-
greedy manner? ?
Given the following line of text:
From Sat Jan 5 09:14:16 2008