0

I was looking for some answers, but I couldn't find any. There is this code (from stackover flow) that I don't understand:

if re.search("\b{0}\b".format(w),line):

The "\b" is what I do not understand. What does it do?

Thanks!

I'm trying to make this login application by the way. So I'm trying to save passwords.

  • 1
    That code is wrong. The `\b`s mean something entirely different from what the author wanted them to mean, because the author forgot to use the `r` prefix for a raw string literal. – user2357112 Nov 03 '17 at 00:06
  • Also, [please Google first](https://www.google.com/search?q=python+backslash+b). Typing out the names of special characters in the search often helps. – user2357112 Nov 03 '17 at 00:09
  • 1
    `\b` -> word boundary. https://docs.python.org/3/howto/regex.html – Arun Karunagath Nov 03 '17 at 00:14

0 Answers0