wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python RegEx

Total questions: 7

Worksheet time: 4mins

Name
Class
Date
1.

We import this module to work with regular expressions.

a)

re

b)

ReEx

c)

RegEx

d)

Reg

2.

The meaning of the meta character * is

a)

One or more occurrences

b)

Occurrences only for Numbers

c)

Zero or more occurrences

d)

Occurrences only for strings

3.

Which is not a meta character

a)

*

b)

%

c)

/

d)

\

4.

functions that belongs to regular expression module

a)

findall

b)

match

c)

search

d)

All the above

5.

"\S" returns a

a)

Match where the string DOES NOT contain a white space character

b)

Match where the string CONTAINS a white space character

c)

Match where the string DOES NOT contain any word characters

d)

Match where the string DOES NOT contain digits

6.

[^pqr] returns a

a)

Match for characters p, q, r, P, Q and R only

b)

Match for characters p, q, and r only

c)

Match for any character contain p, q, and r

d)

Match for any character except p, q, and r

7.

Which returns a match for any alphabetic lower or upper case character between a and z.

a)

[a-z]

b)

[a-z-A-Z]

c)

[a-z][A-Z]

d)

[azAZ]