Update README.md

Add new example for word boundary inside the Anchors section
This commit is contained in:
Md. Sany Ahmed 2018-03-26 21:25:36 +06:00 committed by GitHub
parent 416b213d2a
commit 6278908aa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -367,6 +367,30 @@ character and the matcher must be end of the string.
[Test the regular expression](https://regex101.com/r/t0AkOd/1) [Test the regular expression](https://regex101.com/r/t0AkOd/1)
### 2.8.3 Word Boundary
`\b` Matches, without consuming any characters, immediately between a character matched by \w and a character not matched by \w (in either order). It cannot be used to separate non words from words.. For example, regular expression `\bfat\b` means: a
lowercase character `f`, followed by lowercase character `a`, followed by a `t` character and the matcher must be a word on the string.
<pre>
"\bfat\b" => The <a href="#learn-regex"><strong>fat</strong></a> cat. sat. on the mat with the fatty cat.
</pre>
[Test the regular expression](https://regex101.com/r/y4Au4D/8)
<pre>
"\bfat" => The <a href="#learn-regex"><strong>fat</strong></a> cat. sat. on the mat with the <a href="#learn-regex"><strong>fat</strong>ty cat.
</pre>
[Test the regular expression](https://regex101.com/r/OXYjxn/1)
<pre>
"fat\b" => The <a href="#learn-regex"><strong>fat</strong></a> cat. sat. on the mat with the fatty cat.
</pre>
[Test the regular expression](https://regex101.com/r/nAOq0x/1)
## 3. Shorthand Character Sets ## 3. Shorthand Character Sets
Regular expression provides shorthands for the commonly used character sets, Regular expression provides shorthands for the commonly used character sets,