This is my code:
var boo = new RegExp("\\Bis\\B","gi");
var result = boo.exec("this AisA stackoverflow");
document.write(result);
The result is: “is” but i want the function exec to return the whole match ie AisA using
the non-word boundary \B. I know i can use a pattern such as .+is.+ to return AisA but
i’m wondering how to do the same thing with a non-word boundary.
Try this:
This will check for the non-boundary, and also take that character with the
..