“JavScript Match Word w ciągu” Kod odpowiedzi

Dopasuj słowo w ciągu JS

let string = "Hello world"; // you can use .toLowerCase() to check only in lower

let match = "world"; // word to match

let regex = new RegExp('\\b('+match+')\\b');

console.log('true for no match, false for match');
console.log(string.match(regex) == null); //.match() returns array of words found

// true for no match, false for match
// false
L'homme habile

JavScript Match Word w ciągu

let stringToSearch = 'looking for value';
let valueToFind = /off/gi 
let isValueInString = Boolean(stringToSearch.match(valueToFind));
Worried Worm

Odpowiedzi podobne do “JavScript Match Word w ciągu”

Pytania podobne do “JavScript Match Word w ciągu”

Więcej pokrewnych odpowiedzi na “JavScript Match Word w ciągu” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu