Skip to content

Commit 8af2fe0

Browse files
falaktheoptimistziishaned
authored andcommitted
Minor corrections, typo fixes and example update (ziishaned#14)
1 parent 572c456 commit 8af2fe0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ We use the following regular expression to validate a username:
1919
<img src="https://i.imgur.com/UrDb9qc.png" alt="Regular expression">
2020
</p>
2121

22-
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
2323
contains uppercase letter and also it is too short.
2424

2525
## Table of Contents
@@ -54,7 +54,7 @@ contains uppercase letter and also it is too short.
5454

5555
## 1. Basic Matchers
5656

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
5858
`cat` means: the letter `c`, followed by the letter `a`, followed by the letter `t`.
5959

6060
<pre>
@@ -73,7 +73,7 @@ case-sensitive so the regular expression `Cat` would not match the string "cat".
7373

7474
Meta characters are the building blocks of the regular expressions. Meta characters do not stand for themselves but instead are
7575
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:
7777

7878
|Meta character|Description|
7979
|:----:|----|
@@ -148,7 +148,7 @@ spaces, followed by lowercase character `c`, followed by lowercase character `a`
148148
zero or more spaces.
149149

150150
<pre>
151-
"\s*cat\s*" => The fat<a href="#learn-regex"><strong> cat </strong></a>sat on the <a href="#learn-regex"><strong>cat</strong></a>.
151+
"\s*cat\s*" => The fat<a href="#learn-regex"><strong> cat </strong></a>sat on the <a href="#learn-regex">con<strong>cat</strong>enation</a>.
152152
</pre>
153153

154154
### 2.3.2 The Plus
@@ -175,8 +175,8 @@ character `h`, followed by the lowercase character `e`.
175175

176176
## 2.4 Braces
177177

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 (
180180
characters in the range of 0 to 9).
181181

182182
<pre>
@@ -197,7 +197,7 @@ the comma the regular expression `[0-9]{2}` means: Match exactly 2 digits.
197197
## 2.5 Character Group
198198

199199
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
201201
it repeats the whole character group. For example the regular expression `(ab)*` matches zero or more repetitions of the character "ab".
202202
We can also use the alternation `|` meta character inside character group. For example the regular expression `(c|g|p)ar` means: lowercase character `c`,
203203
`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
232232

233233
## 2.8 Anchors
234234

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
236236
we use anchors. Anchors are of two types: First type is Caret `^` that check if the matching character is the start character of the
237237
input and the second type is Dollar `$` that checks if matching character is the last character of the input string.
238238

0 commit comments

Comments
 (0)