Please enable JavaScript.
Coggle requires JavaScript to display documents.
Regex (Splitting and Extracting New Columns (RegEx (Examples (ab?c (abc -…
Regex
Splitting and Extracting New Columns
RegEx
Escape character - \
\d\d\d means 3 digits
\D means any character except digits
from uppercase and lowercase a-Z as well as dashes
\w means any alpha-numeric character
\W is to find non-alphanumeric characters
\W\W\W\W --
#$%
.\ returns any and all characters
Examples
a\dc
a1c - found
a5c - found
abc - not found
a\Dc
aGc - found
a-c - found
a3c - not found
a\wc
aGc - found
a-c - not found
a1c - found
a\Wc
aGc - not found
a-c - found
a
c
- found
a.c
aGc - found
a-c - found
a
c
- found
ab?c
abc - found
abd - found
adb - not found
character following the ? is optional
a\sc
a c - found
aa c - found
abc - not found
\s matches any whitespace
a\Sc
a c - not found
aa c - not found
abc - found
\S anything but whitespace
Bracket Examples
a[Ga]c
aGc - found
aac - found
a
c
-not found
a[^Ga]c - anything but characters listed in bracket
aGc - not found
aac - not found
aTc - found
ab|cd - either pattern is acceptable
abc - found
bcd - found
adc - not found
^ab - beginning of string being examined
aab - not found
abc - found
bcab - not found
ab$ - end of string being examined
aab - found
abc - not found
bcab - found
Repeated patterns
ab*
a - found
aab - found
abbbb - found
begins with "a" and contains any number of b's
a{3}
a - not found
aa - not found
aaa - found
pattern is 3 a's
ab+
a - not found
aab - found
abbb - found
pattern begins with a and must be followed by at least one b
a{2,4}
a - not found
aa - found
aaa - found
pattern is between 2 and 4 a's
More examples - Titanic
(Mr?s)
captures "Mr" and "Mrs"