Please enable JavaScript.
Coggle requires JavaScript to display documents.
Regular Expressions (RegEx Alphabet (\W (any non-alphanumeric value), \w…
Regular Expressions
RegEx Alphabet
\W
any non-alphanumeric value
\w
any alphanumeric value
. (period)
"royalty" of RegEx
returns ANY character
?
creates "optional" characters
character directly proceeding not necessary for match
\s
searches for whitespaces
space, tab, etc.
\S
returns anything except whitespace
^
beginning of string being examined
$
end of string being examined
Powerful, flexible language
Replacing in text
Extracting from text
Finding in text
Specified pattern
Regex system checks text for pattern
marks all text that fits pattern
Can identify context around pattern
Escape character
interpreted as special command
\d
will mark any digit
\d\d\d
marks any three digits
\D
marks any NON-digit
Search for 303 and 720
[] square brackets
create list of allowable characters
[37]\d\d
allows 3 and 7 as first character
allows any digit as second and third character
303|720
using pipe symbol allows for both patterns to be accepted
Captures/Repetition
Captures
explicit notation of any substring
create columns for ML
Repetition
specifying a pattern repeats a # of times
(asterisk)
pattern can match 0 to infinite times
pattern doesnt have to occur once
has to occur in a string
(plus)
specifies pattern has to occur once
{}
upper/lower bounds for how many times pattern can occur