Tutorial
Tools & Languages
Examples
Reference
Matching a Word 6 to 12 Letters Long Containting "Cat", "Dog" or "Mouse"
\b
(?=
\w
{6,12}
\b
)
\w
{0,9}
(
cat
|
dog
|
mouse
)
\w
*
Options: case insensitive
Assert position at a word boundary
Assert that the regex below can be matched, starting at this position (positive lookahead)
Match a character that is a "word character" (letters, digits, etc.)
Between 6 and 12 times, as many times as possible, giving back as needed (greedy)
Assert position at a word boundary
Match a character that is a "word character" (letters, digits, etc.)
Between zero and 9 times, as many times as possible, giving back as needed (greedy)
Match the regular expression below and capture its match into backreference number 1
Match either the regular expression below (attempting the next alternative only if this one fails)
Match the characters "cat" literally
Or match regular expression number 2 below (attempting the next alternative only if this one fails)
Match the characters "dog" literally
Or match regular expression number 3 below (the entire group fails if this one fails to match)
Match the characters "mouse" literally
Match a character that is a "word character" (letters, digits, etc.)
Between zero and unlimited times, as many times as possible, giving back as needed (greedy)
Welcome
Tutorial
Tools and Languages
Examples
Reference
About This Site
Download and Print