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
Copy file name to clipboardExpand all lines: en/regular-expression.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ A regular expression is an object that can either be constructed with the `RegEx
15
15
newRegExp(pattern[, flags]);
16
16
17
17
// using literals
18
-
/pattern/modifiers
18
+
/pattern/flags
19
19
```
20
20
21
21
The flags are optional while creating a regular expression using literals. Example of creating identical regular using above mentioned method is as follows.
@@ -39,7 +39,7 @@ Example :
39
39
40
40
```javascript
41
41
conststr="Hello world, hello again!";
42
-
constregex=/hello/g;
42
+
constregex=/hello/gi;
43
43
constmatches=str.match(regex);
44
44
// If you are thinking about .match() Read This π
45
45
// It is a built-in method in JavaScript that is used to search a string for a match against an expression.
@@ -175,11 +175,11 @@ _Metacharacters_ are special character that has special meaning in the regular e
0 commit comments