Commit 753cc715 authored by JEAN-YVES SGRO's avatar JEAN-YVES SGRO
Browse files

Update regex_intro.md to add definition of `\b`

parent 96e6c054
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line

## Regular expressions

A regular expression, often shortened to "regex," is a sequence of characters that define a *search pattern*. Regex is used in many programming languages to perform pattern matching on strings, *i.e.*, "***find and replace***" type operations.
@@ -15,7 +14,7 @@ A regex to match a valid email address might be: `\b[A-Za-z0-9._%+-]+@[A-Za-z0-9

A regex to match a US phone number in the format `xxx-xxx-xxxx` might be: `\b\d{3}-\d{3}-\d{4}\b`.

A regex to match all the occurrences of the word "dog" in a sentence could be: `\bdog\b`.
A regex to match all the occurrences of the word "dog" in a sentence could be: `\bdog\b`. `\b` defines the *boundaries* of the word.


## Worked example