You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Above regular expression can accept the strings `john_doe`, `jo-hn\_doe` and `john12\_as`. It does not match `Jo` because that string
22
+
Above regular expression can accept the strings `john_doe`, `jo-hn_doe` and `john12_as`. It does not match `Jo` because that string
23
23
contains uppercase letter and also it is too short.
24
24
25
25
## Table of Contents
@@ -54,7 +54,7 @@ contains uppercase letter and also it is too short.
54
54
55
55
## 1. Basic Matchers
56
56
57
-
A regular expression is just a pattern of letters and digits that we used to search in a text. For example the regular expression
57
+
A regular expression is just a pattern of letters and digits that we use to perform search in a text. For example the regular expression
58
58
`cat` means: the letter `c`, followed by the letter `a`, followed by the letter `t`.
59
59
60
60
<pre>
@@ -73,7 +73,7 @@ case-sensitive so the regular expression `Cat` would not match the string "cat".
73
73
74
74
Meta characters are the building blocks of the regular expressions. Meta characters do not stand for themselves but instead are
75
75
interpreted in some special way. Some meta characters have a special meaning that are written inside the square brackets.
76
-
The meta character are as follows:
76
+
The meta characters are as follows:
77
77
78
78
|Meta character|Description|
79
79
|:----:|----|
@@ -148,7 +148,7 @@ spaces, followed by lowercase character `c`, followed by lowercase character `a`
148
148
zero or more spaces.
149
149
150
150
<pre>
151
-
"\s*cat\s*" => The fat<ahref="#learn-regex"><strong> cat </strong></a>sat on the <ahref="#learn-regex"><strong>cat</strong></a>.
151
+
"\s*cat\s*" => The fat<ahref="#learn-regex"><strong> cat </strong></a>sat on the <ahref="#learn-regex">con<strong>cat</strong>enation</a>.
152
152
</pre>
153
153
154
154
### 2.3.2 The Plus
@@ -175,8 +175,8 @@ character `h`, followed by the lowercase character `e`.
175
175
176
176
## 2.4 Braces
177
177
178
-
In regular expression braces that are also called quantifiers used to specify the number of times that a group of character or a
179
-
character can be repeated. For example the regular expression `[0-9]{2,3}` means: Match at least 2 digits but not more than 3 (
178
+
In regular expression braces that are also called quantifiers are used to specify the number of times that a
179
+
character or a group of characters can be repeated. For example the regular expression `[0-9]{2,3}` means: Match at least 2 digits but not more than 3 (
180
180
characters in the range of 0 to 9).
181
181
182
182
<pre>
@@ -197,7 +197,7 @@ the comma the regular expression `[0-9]{2}` means: Match exactly 2 digits.
197
197
## 2.5 Character Group
198
198
199
199
Character group is a group of sub-pattern that is written inside Parentheses `(...)`. As we discussed before that in regular expression
200
-
if we put quantifier after character than it will repeats the preceding character. But if we put quantifier after a character group than
200
+
if we put a quantifier after a character than it will repeat the preceding character. But if we put quantifier after a character group then
201
201
it repeats the whole character group. For example the regular expression `(ab)*` matches zero or more repetitions of the character "ab".
202
202
We can also use the alternation `|` meta character inside character group. For example the regular expression `(c|g|p)ar` means: lowercase character `c`,
203
203
`g` or `p`, followed by character `a`, followed by character `r`.
@@ -232,7 +232,7 @@ expression `(f|c|m)at\.?` means: lowercase letter `f`, `c` or `m`, followed by l
232
232
233
233
## 2.8 Anchors
234
234
235
-
In regular expression to check if the matching symbol is the starting symbol or ending symbol of the input string for this purpose
235
+
In regular expressions, to check if the matching symbol is the starting symbol or ending symbol of the input string for this purpose
236
236
we use anchors. Anchors are of two types: First type is Caret `^` that check if the matching character is the start character of the
237
237
input and the second type is Dollar `$` that checks if matching character is the last character of the input string.
0 commit comments