Pattern Meaning
\b "Word" edge (next to non "word" character)
\bring Word starts with "ring", ex ringtone
ring\b Word ends with "ring", ex spring
\b9\b Match single digit 9, not 19, 91, 99, etc..
\b[a-zA-Z]{6}\b Match 6-letter words
\B Not word edge
\Bring\B Match springs and wringer
^\d*$ Entire string must be digits
^[a-zA-Z]{4,20}$ String must have 4-20 letters
^[A-Z] String must begin with capital letter
[\.!?"')]$ String must end with terminal puncutation
Comments