Assuming PCRE-style regular expressions:
If you want to test it as a single, complete word, it \bTest\b , with appropriate flags for case insensitivity, if necessary, and delimiters for your programming language. \b represents the "word boundary", that is, the point between the characters where the word can be considered the start or end. For example, since spaces are used to separate words, there will be a word boundary on each side of the space.
If you want to test it as part of a word, it's just Test , again with the appropriate flags for case insensitivity. Please note that the commonly used βsubstringβ methods are faster in this case because they eliminate the overhead of regular expression analysis.
Michael Madsen Feb 15 '11 at 1:22 2011-02-15 01:22
source share