08 Regular Expressions Flashcards

1
Q

Also known as regex, it is a character or a sequence of characters that represent a string or multiple strings.

A

Regular expression

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the package used for regular expressions?

A

java.util.regex;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the method that returns true if a string matches the given regular expression?

A

matches(String regex)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

It is the wildcard operator that represents any single character in regular expressions.

A

dot (.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

It is any symbol in regular expressions that indicates the number of times a specified character appears in a matching string.

A

Repetition Operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the repetition operators?

A

*
?
+
{x}
{x,y}
{x,}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Repetition operator when there is 0 or more occurrences.

A

*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Repetition operator when there is 0 or 1 occurrence.

A

?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Repetition operator when there is 1 or more occurrence.

A

+

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Repetition operator when there is an x number of occurences.

A

{x}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Repetition operator when there is a number between x & y occurrences.

A

{x,y}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Repetition operator when there is a number of x or more occurrences.

A

{x,}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Class that stores the format of a regular expression.

A

Pattern class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A method that compiles the give regular expression into a pattern.

A

compile()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Class that stores a possible match between a pattern and a string.

A

Matcher class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Method that scans the input sequence looking for the next subsequence that matches the pattern.

A

find()

17
Q

Method that splits the string around matches of the given regular expression.

A

split()

18
Q

Method that is used to replace all the occurrences of the defined regular expression found in the string with another string.

A

replaceAll()