RegEx Flashcards
Alternation definition
Chooses one alternative or the other
Bell (alarm) definition
Device control code sent to ring a small bell
Carriage return definition
Returns the position of the cursor to the first position on the same line
Vertical tab definition
A tab function that moves the cursor up or down 6 spaces
Form feed definition
Forces the printer to eject the current page and continue printing at the top of another
ASCII definition
Character encoding standard for electronic communication
ASCII pronunciation
/‘æski:/
Octal definition
A base-8 number system using 0 to 7
ASCII octal number of digits
Up to 3
Hexadecimal definition
Positional system using base of 16
ASCII hexadecimal number of digits
2
Unicode hexadecimal number of digits
4
Control character
A character such as control-C
Word character definition
a-z, A-Z, 0-9, _
Whitespace character
space, tab, newline
Decimal digit definition
0-9
Start of a string metacharacter
Start of a string example
^abc
abc, abcdefg, abc123
End of a string metacharacter
$
End of a string example
abc$
abc, endsinabc, 123abc
Any character (except \n)
.
Any character except \n example
a.c
abc, aac, acc, adc, aec
Alternation metacharacter
|
Alternation example
bill|ted
ted, bill
Explicit quantifier metacharacter
{…}
Explicit quantifier example
ab{2}c
abbc
Explicit set of characters to match metacharacters
[…]
Explicit set of characters to match example
a[bB]c
abc, aBc
Logical grouping of part of an expression metacharacters
(…)
Logical grouping of part of an expression example
(abc){2}
abcabc
0 or more of previous expression metacharacter
*
0 or more of previous expression example
ab*c
ac, abc, abbc, abbbc
1 or more of previous expression metacharacter
+
1 or more of previous expression example
ab+c
abc, abbc, abbbc
0 or 1 of previous expression metacharacter
?
0 or 1 of previous expression example
ab?c
ac, abc
Escape metacharacter
\
Escape example
a.c
a.c
Bell (alarm) character escape
\a
Backspace (if in []) or word boundary character escape
\b
Tab character escape
\t
Carriage return character escape
\r
Vertical tab character escape
\v
Form feed character escape
\f
New line character escape
\n
Escape character escape
\e
ASCII octal character escape example
\040
ASCII hexadecimal character escape example
\x20
ASCII control character escape example
\cC
Unicode hexadecimal character escape example
\u0020
Escape character for any character which is not an escaped character
*
Character class for any character except \n
.
Character class for any single character in the specified set of characters
[aeiou]
Character class for any single character not in the specified set of characters
[^aeiou]
Character class for specifying a range of contiguous characters
Hyphen (-)
[0-9a-fA-F]
Character class specified by {name} including unicode groups and block ranges
\p{name}
Character class specified by {name} excluding those in the named group
\P{name}
Character class for any word character
\w
Character class for any nonword character
\W
Character class for any white-space character
\s
Character class for any non-white-space character
\S
Character class for any decimal digit
\d
Character class for any nondigit
\D