String regex Quiz

String regex Quiz

12th Grade

9 Qs

quiz-placeholder

Similar activities

STRING MANIPULATION (PYTHON)

STRING MANIPULATION (PYTHON)

11th - 12th Grade

10 Qs

AP Computer Science Principles Unit 3 Review

AP Computer Science Principles Unit 3 Review

9th - 12th Grade

10 Qs

Website Design

Website Design

KG - University

10 Qs

Hex and ASCII Quiz

Hex and ASCII Quiz

9th - 12th Grade

10 Qs

Java String class methods

Java String class methods

10th - 12th Grade

10 Qs

Quiz1 (Quarter2) - Oracle

Quiz1 (Quarter2) - Oracle

12th Grade

10 Qs

JavaScript Variables and Arithmetic

JavaScript Variables and Arithmetic

8th - 12th Grade

14 Qs

AP Computer Science Principles Practice Module

AP Computer Science Principles Practice Module

9th - 12th Grade

13 Qs

String regex Quiz

String regex Quiz

Assessment

Quiz

Computers

12th Grade

Medium

Created by

PHIL WILLIAMS

Used 2+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the character class [a-z] represent in regex?

Any lowercase letter from a to z

Any number from 1 to 26

Any uppercase letter from A to Z

Any special character from a to z

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which quantifier in regex matches 0 or 1 occurrence of the preceding element?

{}

+

?

*

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the use of grouping in regex with an example.

Grouping in regex is used to remove special characters from a pattern.

Grouping in regex is used to apply quantifiers to multiple characters, capture subpatterns, or create alternation. For example, (ab)+ will match one or more occurrences of 'ab'.

Grouping in regex is used to change the order of characters in a pattern.

Grouping in regex is used to match any character in a pattern.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of using the character class [0-9] in regex?

To match any single digit from 1 to 9

To match any special character

To match any single letter from a to z

To match any single digit from 0 to 9.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which quantifier in regex matches 0 or more occurrences of the preceding element?

?

+

!

*

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you use grouping to capture a specific part of a string in regex?

By using curly braces {} to create a capturing group

By using parentheses () to create a capturing group

By using angle brackets <> to create a capturing group

By using square brackets [] to create a capturing group

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain the difference between the character classes [A-Z] and [a-z] in regex.

[A-Z] matches uppercase letters and [a-z] matches lowercase letters.

[A-Z] matches lowercase letters and [a-z] matches uppercase letters.

[A-Z] matches numbers and [a-z] matches special characters.

[A-Z] matches vowels and [a-z] matches consonants.

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the significance of using the character class [^] in regex?

It matches any character including the ones listed

It only matches the first character in the list

It matches any character except for special characters

It matches any character except the ones listed

9.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you use character classes to match any alphanumeric character in regex?

[a-zA-Z]

[A-Z0-9]

[a-z0-9]

[a-zA-Z0-9]