
Content Manager 227
Notes
•
\W
matches any character that’s not a letter, digit, or
underscore. It prevents the regex from matching
characters before or after the phrase.
• In example 2,
\s
matches a space character, and
{0,3}
indicates that from 0 to 3 spaces can occur between the
words stock and tip.
•
^
matches the start of a new line. Allows the regex to
match the phrase if it appears at the beginning of a line,
with no characters before it.
•
$
matches the end of a line. Allows the regex to match
the phrase if it appears at the the end of a line, with no
characters after it.
• In example 3,
(s)
matches the letter s, and
{0,1}
indicates that the letter can occur 0 or 1 times after the
word tip. Therefore, the regex matches stock tip and
stock tips. Alternatively, you can use the character
?
instead of
{0,1}
.
Comentarios a estos manuales