Special characters Flashcards

(45 cards)

1
Q

.

A

matches any single character except line terminators

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

\d

A

matches any digit === [0-9]

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

\D

A

matches any non digit

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

\w

A

matches any alphanumeric character from basic latin alphabet including underscore

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

\W

A

matches any character that is not a word character from the basic latin alphabet

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

\s

A

matches a single white space character

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

\S

A

matches a single character other than white space

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

\t

A

matches a horizontal tab

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

\r

A

matches a carriage return

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

\n

A

matches a linefeed

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

\v

A

matches a vertical tab

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

\f

A

matches a form-feed

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

[\b]

A

matches a backspace

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

\0

A

matches a NUL character

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

\cX

A

where X is a letter from A-Z, matches a control character in a string

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

\xhh

A

matches the character with code hh(two hexadecimal digits)

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

\uhhhh

A

matches a UTF-16 code-unit with the value hhhh(four hexadecimal digits)

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

\

A

indicates that the next character is special and not to be interpreted literally

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

[xyz] [a-c]

A

matches any one of enclosed characters can specify range with hyphen, hyphen can be literal if at end

20
Q

[^xyz]

A

negated or complemented character set

21
Q

x|y

A

matches either x or y

22
Q
A

matches beginning of input

23
Q

$

A

matches end of input

24
Q

\b

A

matches a word boundary (i.e start or end)

25
\B
matches a non-word boundary
26
(x)
matches x and remembers match, capturing groups
27
\n
where n is positive integer, back reference to last substring matching the n
28
(?:x)
matches x but does not remember, non capturing groups
29
x*
matches the preceding item x 0 or more times
30
x+
matches the preceding item x 1 or more times === {1,}
31
x?
matches preceding item x 0 or 1 time
32
x{n}
where n is a positive integer matches exactly n occurences of the preceding item x
33
x{n,}
where n is a positive integer matches at least n occurences
34
x{n,m}
matches at least n and at most m of x
35
?
matches preceding item but smallest possible
36
x(?=y)
matches x only if followed by y
37
x(?!y)
matches x only if x is not followed by y
38
compile()
compiles reg expression during execution of a script
39
exex()
executes a search for a match in its string parameter
40
test()
tests for a match in its string parameter
41
match()
performs match to given string and returns match result
42
replace()
replaces matches in given string with new substring
43
search()
searches match in given string and returns index
44
split()
splits given string into an array by separating the string into substring
45
lastIndex
returns last index of reg expression