Skip to content

Commit 65d10ba

Browse files
authored
Merge pull request Asabeneh#88 from venkatprasadh/master
RegExp constructor name typo fixed.
2 parents 5b53d3f + 6f224d7 commit 65d10ba

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

12_Day/12_day_regular_expressions.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,22 @@
1919

2020
- [📘 Day 12](#%f0%9f%93%98-day-12)
2121
- [Regular Expressions](#regular-expressions)
22-
- [RegEx parameters](#regex-parameters)
22+
- [RegExp parameters](#regex-parameters)
2323
- [Pattern](#pattern)
2424
- [Flags](#flags)
25-
- [Creating a pattern with RegEx Constructor](#creating-a-pattern-with-regex-constructor)
26-
- [Creating a pattern without RegEx Constructor](#creating-a-pattern-without-regex-constructor)
27-
- [RegExp Object Methods](#regexp-object-methods)
25+
- [Creating a pattern with RegExp Constructor](#creating-a-pattern-with-regex-constructor)
26+
- [Creating a pattern without RegExp Constructor](#creating-a-pattern-without-regex-constructor)
27+
- [RegExpp Object Methods](#regexp-object-methods)
2828
- [Testing for a match](#testing-for-a-match)
2929
- [Array containing all of the match](#array-containing-all-of-the-match)
3030
- [Replacing a substring](#replacing-a-substring)
3131
- [Square Bracket](#square-bracket)
32-
- [Escape character(\\) in RegEx](#escape-character-in-regex)
32+
- [Escape character(\\) in RegExp](#escape-character-in-regex)
3333
- [One or more times(+)](#one-or-more-times)
3434
- [Period(.)](#period)
3535
- [Zero or more times(*)](#zero-or-more-times)
3636
- [Zero or one times(?)](#zero-or-one-times)
37-
- [Quantifier in RegEx](#quantifier-in-regex)
37+
- [Quantifier in RegExp](#quantifier-in-regex)
3838
- [Cart ^](#cart)
3939
- [Exact match](#exact-match)
4040
- [💻 Exercises](#%f0%9f%92%bb-exercises)
@@ -46,11 +46,11 @@
4646

4747
## Regular Expressions
4848

49-
A regular expression or RegEx is a small programming language that helps to find pattern in data. A RegEx can be used to check if some pattern exists in a different data types. To use RegEx in JavaScript either we use RegEx constructor or we can declare a RegEx pattern using two forward slashes followed by a flag. We can create a pattern in two ways.
49+
A regular expression or RegExp is a small programming language that helps to find pattern in data. A RegExp can be used to check if some pattern exists in a different data types. To use RegExp in JavaScript either we use RegExp constructor or we can declare a RegExp pattern using two forward slashes followed by a flag. We can create a pattern in two ways.
5050

5151
To declare a string we use a single quote, double quote a backtick to declare a regular expression we use two forward slashes and an optional flag. The flag could be g, i, m, s, u or y.
5252

53-
### RegEx parameters
53+
### RegExp parameters
5454

5555
A regular expression takes two parameters. One required search pattern and an optional flag.
5656

@@ -66,47 +66,47 @@ Flags are optional parameters in a regular expression which determine the type o
6666
- i: case insensitive flag(it searches for both lowercase and uppercase)
6767
- m: multiline
6868

69-
### Creating a pattern with RegEx Constructor
69+
### Creating a pattern with RegExp Constructor
7070

7171
Declaring regular expression without global flag and case insensitive flag.
7272

7373
```js
7474
// without flag
7575
let pattern = 'love'
76-
let regEx = new RegEx(pattern)
76+
let regEx = new RegExp(pattern)
7777
```
7878

7979
Declaring regular expression with global flag and case insensitive flag.
8080

8181
```js
8282
let pattern = 'love'
8383
let flag = 'gi'
84-
let regEx = new RegEx(pattern, flag)
84+
let regEx = new RegExp(pattern, flag)
8585
```
8686

87-
Declaring a regex pattern using RegEx object. Writing the pattern and the flag inside the RegEx constructor
87+
Declaring a regex pattern using RegExp object. Writing the pattern and the flag inside the RegExp constructor
8888

8989
```js
90-
let regEx = new RegEx('love','gi')
90+
let regEx = new RegExp('love','gi')
9191
```
9292

93-
### Creating a pattern without RegEx Constructor
93+
### Creating a pattern without RegExp Constructor
9494

9595
Declaring regular expression with global flag and case insensitive flag.
9696

9797
```js
9898
let regEx= /love/gi
9999
```
100100

101-
The above regular expression is the same as the one which we created with RegEx constructor
101+
The above regular expression is the same as the one which we created with RegExp constructor
102102

103103
```js
104-
let regEx= new RegEx('love','gi')
104+
let regEx= new RegExp('love','gi')
105105
```
106106

107-
### RegExp Object Methods
107+
### RegExpp Object Methods
108108

109-
Let see some of RegEx methods
109+
Let see some of RegExp methods
110110

111111
#### Testing for a match
112112

@@ -297,7 +297,7 @@ console.log(matches)
297297

298298
Using the square bracket and or operator , we manage to extract Apple, apple, Banana and banana.
299299

300-
### Escape character(\\) in RegEx
300+
### Escape character(\\) in RegExp
301301

302302
```js
303303
const pattern = /\d/g // d is a special character which means digits
@@ -370,7 +370,7 @@ console.log(matches) // ["e-mail", "email", "Email", "E-mail"]
370370

371371
```
372372

373-
### Quantifier in RegEx
373+
### Quantifier in RegExp
374374

375375
We can specify the length of the substring we look for in a text, using a curly bracket. Lets imagine, we are interested in substring that their length are 4 characters
376376

0 commit comments

Comments
 (0)