Regex Repetition Qualifiers, Anchors, and Grouping
Learn about the different functionalities of using regular expressions.
We'll cover the following
Regex repetition qualifiers
It’s possible to repeat either a portion or a full regex pattern. The metacharacters to do so are *
, +
, ?
, and {}
:
*
: It specifies that the character previous to it can be repeated zero or more times.+
: It specifies that the character previous to it can be repeated one or more times.?
: It specifies that the character previous to it can be repeated zero or one time.{m}
: It specifies that exactlym
copies of the previous regular expression should be matched.{m,n}
: It causes the resulting regular expression to match fromm
ton
repetitions of the preceding regular expression.
Get hands-on with 1200+ tech skills courses.