Quote:
Originally Posted by ElMiko
related question:
why does \b match letters that come after an apostrophe?
eg. A search fro ’\b matches the apostrophes in "there’s" "it’s" "Bob’s", etc...
|
\b doesn't really "match"
any characters—or more technically, its match is zero-length. It matches word
boundaries. Which can be:
* Before the first character in the string, if the first character is a word character.
* After the last character in the string, if the last character is a word character.
* Between two characters in the string, where one is a word character and the other is not a word character.
A word character—without the (*UCP) flag—is [a-zA-Z0-9_] or \w
"There's"—for better or worse—is not one word in the eyes of regex. Because an apostrophe is not a word character. "There" would be one word and "s" would be another.
What are you
wishing ’\b would find?