Special characters Flashcards

You may prefer our related Brainscape-certified flashcards:
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
Q

\B

A

matches a non-word boundary

26
Q

(x)

A

matches x and remembers match, capturing groups

27
Q

\n

A

where n is positive integer, back reference to last substring matching the n

28
Q

(?:x)

A

matches x but does not remember, non capturing groups

29
Q

x*

A

matches the preceding item x 0 or more times

30
Q

x+

A

matches the preceding item x 1 or more times === {1,}

31
Q

x?

A

matches preceding item x 0 or 1 time

32
Q

x{n}

A

where n is a positive integer matches exactly n occurences of the preceding item x

33
Q

x{n,}

A

where n is a positive integer matches at least n occurences

34
Q

x{n,m}

A

matches at least n and at most m of x

35
Q

?

A

matches preceding item but smallest possible

36
Q

x(?=y)

A

matches x only if followed by y

37
Q

x(?!y)

A

matches x only if x is not followed by y

38
Q

compile()

A

compiles reg expression during execution of a script

39
Q

exex()

A

executes a search for a match in its string parameter

40
Q

test()

A

tests for a match in its string parameter

41
Q

match()

A

performs match to given string and returns match result

42
Q

replace()

A

replaces matches in given string with new substring

43
Q

search()

A

searches match in given string and returns index

44
Q

split()

A

splits given string into an array by separating the string into substring

45
Q

lastIndex

A

returns last index of reg expression