-
"ab*"
matches a string that has an a followed by ZERO or more b's ("a", "ab", "abbb", etc.)
-
ab+": same, but there's at least one b ("ab",
"abbb", etc.)
- matches a string of ONE or more b's,("ab",
- "abbb", etc.)
-
"ab?"
a and maybe a b after
-
"a?b+$":
a possible a followed by one or more b's ending a string
-
"ab{2}"
- matches a string that has an a followed by exactly
- two b's ("abb");
-
ab{2,}
there are at least two b's ("abb", "abbbb", etc.)
-
ab{3,5}
from three to five b's ("abbb", "abbbb", or "abbbbb")
-
"a(bc)*"
matches a string that has an a followed by zero or more copies of the sequence "bc"
-
a(bc){1,5}
one through five copies of "bc."
-
b|cd)ef
a string that has either "bef" or "cdef";
-
a.[0-9]
- matches a string that has an a followed by one
- character and a digit;
-
^.{3}$
a string with exactly 3 characters
-
",[a-zA-Z0-9]$"
a string that ends in a comma followed by an alphanumeric character.
|
|