Quiz2

Quiz2

University

15 Qs

quiz-placeholder

Similar activities

Quiz-4

Quiz-4

University

20 Qs

Pemrograman 2: Regular Expressions (part 1)

Pemrograman 2: Regular Expressions (part 1)

University

10 Qs

Software testing unit 3 and 4

Software testing unit 3 and 4

University

10 Qs

Customer Service Quizlet on Questions

Customer Service Quizlet on Questions

4th Grade - University

10 Qs

Computers make the world smaller and faster

Computers make the world smaller and faster

University

10 Qs

BIOMETRICS-UNIT-I

BIOMETRICS-UNIT-I

University

10 Qs

computers

computers

University

11 Qs

Python-RegEx

Python-RegEx

University

15 Qs

Quiz2

Quiz2

Assessment

Quiz

Computers

University

Medium

Created by

Alok Sahoo

Used 4+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the regex pattern `[a-zA-Z]{3,}` match?

Exactly 3 letters

At least 3 letters (only lowercase)

At least 3 letters (both cases)

Exactly 3 uppercase letters

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which regex pattern matches a valid 10-digit mobile number at the end of a sentence?

'\d{10}$'

'\d{10}'

`^\d{10}`

`\d{10}\b

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will `re.findall(r'[+*/-]|\w+', '12 15+3 100-*')` return?

['12', '15', '+', '3', '100', '-', '*']

['12', '+', '3', '*']

['+', '-', '*']

['12', '15+3', '100-*']

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the regex pattern `(\w+) \1` do?

Matches two different words

Matches the same word repeated

Matches any character

Throws an error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does `re.sub(r'(\w+) \1', r'\1', 'go go gone')` return?

'go gone'

'gone'

'go go gone'

'go gone gone'

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does `re.I` flag do?

Enables indentation

Ignores whitespace

Enables case-insensitive matching

Enables multi-line matching

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you match a literal dash `-` in a character class?

Put it at the start or end like `[-abc]`

. Escape it like `[a\-c]`

Both A and B

You can't match dash using character class

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?