I'm trying to make a dynamic regex that matches a person's name. It works without problems on most names, until I ran into accented characters at the end of the name.
A colleague asked me about a Regular expression problem, and I can't seem to find and answer for him.
We're using boundaries to highlight certain lengths of text in a text editor, ...
I'm trying to create a bad word filter that throws out tweets that contain any of the words in a provided list, case insensitive. Only problem is that I want to ...
A word ...
Regex Pattern: \bgoogle\b
Test case: http://www.google.com/
My question is why ?
What are non-word boundary in regex (\B), compared to word-boundary?
I'm getting unexpected results with this code:
'foo'.match(new RegExp('\bfoo\b')); // Returns null
'foo'.match(new RegExp('foo')); // Returns "foo"
var xr = RegExp("\\bst","g");
xr.test("The string") // --> true