Regular expressions are the sequence of characters and symbols that use the patterns to search the string and text and we can take action according to that. This is used to match character combinations in strings.
We can construct regular expressions in two ways…
- Regular expression literals like let re = /ab+c/;
- With the constructor of RegExp() object. let re = new RegExp('ab+c', modifier);
Post a Comment