What will the following code print?

Week 4 - Day 2 - quizregularexpressions

Quiz
•
Computers
•
University
•
Hard
Clinton Cunha
Used 12+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Any line containing 'From'
Any line that starts with 'From'
Any line that starts with 'From:'
Any line containing 'From:'
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following options is the correct way to import the regex library?
import regex
import re
import Regex
import Re
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which of these option(s) will match digits in a string? Select all that apply.
[0-9]
\D
\d
\w
4.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Which of these lines will be matched when the following code is run?
It will cost you $1.00
From: stephen.marquard@uct.ac.za $a
$2.50 is your change
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
True or false? The following code will match only the first email(up to the @ sign) in the string?
True
False
6.
MULTIPLE SELECT QUESTION
2 mins • 1 pt
Which of the following options will the regular expression ^X-.*: [0-9.]+ match?
X-DSPAM-Probability: Accurate
X-DSPAM-Confidence: 0.8475
X-Wolverine-Confidence: 1
X Wolverine-Confidence: 0.53
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following regex statements will match and return any price of the form $3.45 or $23.32 or $400 found in the string ‘x’?
re.findall('\$\d+\.\d{2}', x)
re.findall('$\d+(?:\.\d{2})?', x)
re.findall('\$\D+(\.\D{2})?', x)
re.findall('\$\d+\.?\d{0,2}', x)
8.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
The expression a{5} will match _____________ characters with the previous regular expression.
5 or less
exactly 5
5 or more
exactly 4
Similar Resources on Quizizz
10 questions
NumPy

Quiz
•
9th Grade - University
9 questions
IDS TAE-III

Quiz
•
University
10 questions
Quiz 11

Quiz
•
University
10 questions
5-函数

Quiz
•
University
10 questions
RegEx in Python

Quiz
•
University
12 questions
Python Quiz

Quiz
•
University
12 questions
kotlin Quiz 2

Quiz
•
University
7 questions
Webtech Tutorium 11 - TCP/IP

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade