0. Root - CSS Variables
Nagative value input
evt = (event) ? event : window.event;
0. Root - CSS Variables
Nagative value input
evt = (event) ? event : window.event;
regEx
Quantifiers
Metacharacters
Groups
flags
/abdul/ | A regular expression |
---|---|
/abdul/i | A case-insensitive regular expression |
/g | Perform a global match (find all) |
/i | Perform case-insensitive matching |
/m | Perform multiline matching |
var pattern = /abdul/
text.match(pattern)
---------------------------------------------------------------------
let text = "aaaabb";
let result = text.match(/(aa)(bb)/d);
---------------------------------------------------------------------------
let text = `Is this
all there
is`
let pattern = /^is/m;
let result = text.match(pattern);
-------------------------------------------------------------------------
The "m" modifier specifies a multiline match.
It only affects the behavior of start ^ and end $.
^ specifies a match at the start of a string.
$ specifies a match at the end of a string.
With the "m" set, ^ and $ also match at the beginning and end of each line.
<p>Do a global, case-insensitive, multiline search for "is" at the beginning of each line in a string.</p>
let text = `Is this
all there
is`
let pattern = /^is/gmi;
-------------------------------------------------------------------------------------------------
<p>The multiline property returns true if the "m" modifier is set, otherwise false:</p>
<p id="demo"></p>
<script>
let text = "Visit W3Schools!";
let pattern = /W3S/gmi;
let result = pattern.multiline;
-------------------------------------------------------------------------------------------------
text.match(pattern) | The String method match() |
text.search(pattern) | The String method search() |
pattern.exec(text) | The RexExp method exec() |
pattern.test(text) | The RegExp method test() |
search() searches a string for a value and returns the position of the first match
match() searches for a match in a string
The test() method returns true if it finds a match, otherwise false.
The exec() method tests for a match in a string
0. Root - CSS Variables 1. Resets 2. HTML Elements 2.1. Links 2.2. Images 2.3. Headings 3. Page Layout 3.1. Layout 3.2...