Skip to content

Commit

Permalink
content restructured
Browse files Browse the repository at this point in the history
  • Loading branch information
Asabeneh committed Jan 5, 2020
1 parent 24752f9 commit 5b047b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions 02_Day/02_day_data_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,10 @@ let patternOne = /love/ // with out any flag
let patternTwo = /love/gi // g-means to search in the whole text, i - case insensitive
```

Match syntax

```js
// syntax
string.match(substring)
```

Expand All @@ -726,7 +729,7 @@ let pattern = /love/gi
console.log(string.match(pattern)) // ["love", "love", "love"]
```

Let us extract numbers from text using regular expression. This is not regular expression section, no panic.
Let us extract numbers from text using regular expression. This is not regular expression section, no panic, we will cover regular expression in other section.

```js
let txt = 'In 2019, I run 30 Days of Python. Now, in 2020 I super exited to start this challenge'
Expand All @@ -740,7 +743,7 @@ console.log(txt.match(regEx)) // ["2", "0", "1", "9", "3", "0", "2", "0", "2",
console.log(txt.match(/\d+/g)) // ["2019", "30", "2020"]
```

20. *repeat()*: it takes a number argument and it returned the repeated version of the string.
20. *repeat()*: it takes a number argument and it returned the repeated version of the string.

```js
string.repeat(n)
Expand Down

0 comments on commit 5b047b9

Please sign in to comment.