Please enable JavaScript.
Coggle requires JavaScript to display documents.
10.1.2 Regular Expressions (RegEx) (More specific RegEx ([ af] specifies…
10.1.2 Regular Expressions (RegEx)
What is it?
powerful & flexible language
find, replace, extract content
Simple RegEx
"555" will find (555) 932-9382
"abc" will find abc plumbing
Complex Regex
Require escape characters
\d any digit
\D any non-digit
\w any alphanumeric character
\W any non-alphanumeric character
period (.) finds anything
question mark (?) makes directly preceding character optional
\s finds whitespace
\S finds non-whitespace
More specific RegEx
[ af] specifies allowable characters to be found
[a-z] dash specifies range
303|720 pipe symbol specifies either pattern could be found
^ not in brackets indicate beginning of string
[^a] specifies when character cannot be found
$ specifies end of a string
star specifies any number of a character can be found
(+) specifies pattern must occur at least once
{3} indicates number of times a character will repeat
{2,4} specifies range where character could repeat
() capture strings that fit the pattern