-
What are three things are found in a regular expression?
ordinary characters, meta-characters, character classes
-
What does the . (dot) in a regular expression match?
one occurrence of any character, except the newline
-
What does the * in a regular expression match?
0 or more occurrences of the character that comes before it
-
What does the + in a regular expression match?
1 or more occurrences of the character that comes before it
-
What does \d in a regular expression match?
a single digit
-
What meta-characters do you use to surround a part of a regular expression that you want
to extract from the matched string?
( )
-
What method on a match object is used to extract the value of a string in a matched line
using the meta-characters mentioned above?
group
-
What is a greedy match?
a match with the greatest number of characters
-
What regular expression would you write if you wanted to match
ONE occurence of either the character "x", or "y", or "z"?
[xyz]
-
What regular expression would you write if you wanted to match anywhere between 3 and 5
occurrences of the letter "q"?
q{3,5}