I need to test a string (Hebrew) for a specific word. Here is a working fiddle.
It work while you're using an English.
So if you test "are you ready" for "are" (true
) or "read" (false
), it works fine.
But if you test "כל הכבוד" for "כל", it returns false
.
JS script I'm using:
var myString = 'Hello world!';
var myWord = 'world';
var regexp = new RegExp('\\b' + myWord + '\\b');
alert(regexp.test(myString));
Does anyone have an idea, why RegExp stops working when you work with Hebrew?