Skip to content

Commit e2fa5b0

Browse files
author
Wakidur Rahaman
committed
Regular Expressions
1 parent 6c36c35 commit e2fa5b0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Regular Expressions
3+
*
4+
* Regular expressions (regexes) are a set of characters that define a search pattern.
5+
*
6+
* The constructor for the RegExp object takes two parameters:
7+
* the regular expression and the optional match settings, as shown here:
8+
*
9+
* i ==> Perform case-insensitive matching
10+
* g ==> Perform a global match (find all matches rather than stopping after first match)
11+
* m ==> Perform multiline matching
12+
*
13+
* RegExp has the following two functions:
14+
* 1. search(): Tests for matches in a string. This returns the index of the match.
15+
* 2. match(): Tests for matches. This returns all the matches.
16+
*
17+
* The JavaScript String object also has the following two regex-related functions that accept the RegExp object as an argument:
18+
* 1. exec(): Tests for matches in a string. This returns the first match.
19+
* 2. test(): Tests for matches in a string. This returns true or false.
20+
*/

0 commit comments

Comments
 (0)