JSFiddle - React, Tailwind, and code Playground

by Mohammed Alozaibi

JavaScript

var phrase = "hello I am mohammed";
phrase.toLowerCase();
phrase.toUpperCase();

var ind = phrase.lastIndexOf("am");
alert(ind);
alert(phrase.slice(8, 10));
//ABC is less than abc | ABC comes before
var myRE = new RegExp("hello"); // or myRE = /hello/;

if ( myRE.test(phrase)) {
    alert("reg found");
}

/*
/^hello/; must be at the begining 
/hello$/;  ============= end
/hell+o/; and number of l   helllo helllllllo
/hel*o/; zero or more L  heo helo hellllo
/hel?o/ zero or one heo or helo
/hello|see ya/; or 
/he..o/ any character
/\whello/; alphanumaric or _
/\bhello/; word boundry new line or space 
/[crnld]ope/; range of letters cope lope dope