diff --git a/README.md b/README.md index ffd6e9c4..47cf48e8 100644 --- a/README.md +++ b/README.md @@ -3,20 +3,6 @@ Learn Regex


-## Translations: - -* [English](README.md) -* [Español](README-es.md) -* [Français](README-fr.md) -* [Português do Brasil](README-pt_BR.md) -* [中文版](README-cn.md) -* [日本語](README-ja.md) -* [한국어](README-ko.md) -* [Turkish](README-tr.md) -* [Greek](README-gr.md) -* [Magyar](README-hu.md) -* [Polish](README-pl.md) - ## What is Regular Expression? > Regular expression is a group of characters or symbols which is used to find a specific pattern from a text. @@ -42,6 +28,24 @@ Above regular expression can accept the strings `john_doe`, `jo-hn_doe` and `john12_as`. It does not match `Jo` because that string contains uppercase letter and also it is too short. + +## 10 Reasons to Learn and Use Regular Expressions + +1. **Regular expressions are everywhere** +2. Regular expression mastery can help you stand out from the crowd +3. Wielding regular expressions can make you feel like a mighty wizard +4. If your search is simple, regular expression syntax is simple +5. Regular expressions are portable +6. Regular expressions can help you write short code +7. Regular expressions save time +8. Regular expressions are fast +9. Regular expressions can match just about anything +10. **Regular expressions are fun** + +Details: http://blog.stevenlevithan.com/archives/10-reasons-to-learn-and-use-regular-expressions + + + ## Table of Contents - [Basic Matchers](#1-basic-matchers) @@ -367,6 +371,30 @@ character and the matcher must be end of the string. [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. + +
+"\bfat\b" => The fat cat. sat. on the mat with the fatty cat.
+
+ +[Test the regular expression](https://regex101.com/r/y4Au4D/8) + +
+"fat\b" => The fat cat. sat. on the mat with the fatty cat.
+
+ +[Test the regular expression](https://regex101.com/r/nAOq0x/2) + +
+"\bfat" => The fat cat. sat. on the mat with the fatty cat.
+
+ +[Test the regular expression](https://regex101.com/r/nAOq0x/1) + + ## 3. Shorthand Character Sets Regular expression provides shorthands for the commonly used character sets, @@ -559,6 +587,8 @@ possible. we can use `?` to match in lazy way means as short as possible [Test the regular expression](https://regex101.com/r/AyAdgJ/2) +**Official Site** : https://www.regular-expressions.info/refflavors.html + ## Contribution * Report issues diff --git a/img/img_original.png b/img/img_original.png index da1c5fa2..30a3b896 100644 Binary files a/img/img_original.png and b/img/img_original.png differ diff --git a/img/regexp-en.png b/img/regexp-en.png index c38c90fb..1c76bce9 100644 Binary files a/img/regexp-en.png and b/img/regexp-en.png differ diff --git a/img/regexp-es.png b/img/regexp-es.png index b8a76240..bc0660ee 100644 Binary files a/img/regexp-es.png and b/img/regexp-es.png differ diff --git a/img/regexp-fr.png b/img/regexp-fr.png index 7712d2e6..3f19b40c 100644 Binary files a/img/regexp-fr.png and b/img/regexp-fr.png differ diff --git a/img/regexp-hu.png b/img/regexp-hu.png index 70d1f516..c4dafb80 100644 Binary files a/img/regexp-hu.png and b/img/regexp-hu.png differ diff --git a/img/regexp-pl.png b/img/regexp-pl.png index 5da2cd42..58703acf 100644 Binary files a/img/regexp-pl.png and b/img/regexp-pl.png differ diff --git a/img/regexp-tr.png b/img/regexp-tr.png index 9285dfcf..4e59286f 100644 Binary files a/img/regexp-tr.png and b/img/regexp-tr.png differ