Loading...
Regex/Grep
A regular expression, regex or regexp
(sometimes
called a rational expression) is a sequence of
characters
that define a
search
pattern
. Usually such patterns are used by
string searching algorithms
for
"find"
or
"find
and replace" operations on
strings
, or for input validation. It is a technique developed in
theoretical computer science
and
formal language
theory.
Wildcards
You can replace parts of words with wildcards matching one, multiple, or a range of characters:
? Matches exactly one character.
*: Matches none, one, or multiple characters.
[a-b]: Matches one character of the range
“a”
through
“b”.
[abc…] or
[a|b|c|…]:
Matches one character out of the given list of characters.
[^…]: Matches one character that is not contained in the given list or range.
Useful Regex expressions
Words in the latin alphabet
\b[A-Za-z]+\b
Words in the Latin alphabet
\b
assert position at a word boundary
A-Z
a single character in the range between A and Z
(case
sensitive)
a-z a single character in the range between a and z
(case
sensitive)
+ Quantifier: matches between one and unlimited times, as many times as possible, giving back as needed
\b assert position at a word boundary
Words in greek
\b\p{Greek}+
Words in greek
[[:space:]][Α-ΩἉἙἩἹὉὩὙἌἜἬἼὌὬἍἝἭἽὍὭὝἊἚἪἺὊὬἋἛἫἻὋὫὛ]
Words in greek beginning in uppercase after a whitespace space. Useful for identifying and isolating the beginning of new sections.
Page numbering
\d*[a|b]\d\d
Bekker numbering
\d*[a|b|c|d|e]\d\d
Stephanus numbering
Please turn on JavaScript to use Paper in all of its awesomeness. ^_^
Wildcards
Useful Regex expressions