10.1.2 Regex

Regulare Expressions (Regex)

A language used to extract text from data

Commands

\d

any digit

\D

\w

any alphanumeric character

any non-digit

\W

any non-alphanumeric character

.

Finds any character

?

makes a character optional (must be behind character)

\s

any white space

\S

any non-white space

[...]

looks for only things inside the brackets

[^...]

looks for things not in brackets

ab|cd

finds string on the right or the left

^

specifies the it must be in the beginning

$

Specifies string must be at the end

*

when after character, it may have none or more

+

must have at least one or more of the character this follows

{...}

shows the number or repeats

{2,4}

repeats between 2 and 4 times

()

captures a string the fits the pattern