
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
What will the following code print?
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 Wayground
8 questions
Tutorat_8

Quiz
•
University
10 questions
Pre Processing

Quiz
•
University
10 questions
Java Arrays

Quiz
•
University
10 questions
Reshaping & vStack&hstack( )

Quiz
•
9th Grade - University
10 questions
Pemrograman 2: Regular Expressions (part 1)

Quiz
•
University
10 questions
Quiz 12

Quiz
•
University
10 questions
Game sobre funções em Python

Quiz
•
University
10 questions
Quiz 8

Quiz
•
University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade