Animations
API
Arrays
Async
Basics
Challenges
Classes
Console
Dates
Debugging
DOM Elements
DOM Methods
DOM Properties
Event Listeners
Flow Control
Forms
Functions
Global Functions
JSON
Keywords
Libraries (3rd party)
Math
Modules
Objects
Snippets
String
Types
Widgets
Window Object
Brackets are used to find a range of characters.
MetaCharacters are characters with a special meaning.
Modifiers are characters with a special meaning.
Quantifiers define quantities.
// Example 1 - finds all occurrences of 'e'. Use 'i' for showing only first occurrence.
var str = "Is anyone out there?";
var patt1 = /[e]/g;
var results = str.match(patt1);
$("#demo1").html(results);
// Example 2
var str2 = "Is anyone out there?" - finds all occurrences of 'anyone';
var patt2 = /anyone/g;
var results2 = str2.match(patt2);
$("#demo2").html(results2);
// Example 3 - finds all matches for 'is' (even partials).
var str3 = "Do you know if this is all there is?";
var patt3 = /[is]/gi;
var results3 = str3.match(patt3);
$("#demo3").html(results3);
// Example 4 - finds '1234'
var str4 = "123456789";
var patt4 = /[1-4]/g;
var results4 = str4.match(patt4);
$("#demo4").html(results4);
https://www.w3schools.com/js/js_regexp.asp
https://www.regexbuddy.com/create.html