How do i check if a particular text exists in a word on its own or a part of a word?
I understand the code below but it work separately.Im looking for a single expression that will also return TRUE for tested,retest but False for test0123,123test. Any help much appreciated
var string_1 = "test";
var string_2 = "retests";
/\btest\b/g.test(string_1);//TRUE
/\Btest\B/g.test(string_2);//TRUE
Do you mean this?