This Regex Pattern: \bgoogle\b Test case: http://www.google.com/ It matches. Why?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Because a period represents a word boundary. That is, it is not part of a word, just as a space, a colon, a semicolon, or a tab character are not part of a word. \b is a zero-width assertion, meaning it does not match anything itself, it just defines something about the match.