Originally posted by YoDe at 2008-7-15 22:36:
\< represents the front boundary of a word, and \> represents the back boundary of a word. As for this sentence, I can't understand it.
Let's give a simple example!
For example, there is a string now, excluding the square brackets on both sides, then
"\<it" can match the word "is" after "this", but the "is" contained in the word "this" cannot be matched, because the "\<" symbol in the expression "\<it" requires that the left side of this "it" is a space or other characters, not letters, underscores, and any characters that make up a word. So the "is" in "this" cannot match the expression. \< only represents a position, where the front is a non-word character and the back is a word character, and \> is the opposite of it.
What are word characters?
a-z, A-Z, _, 0-9 can all be characters that make up a word, and others are not word characters. For example, symbols ~!@#$%^&*()_+... These are not.
You can search for articles about regular expressions on the Internet.
