forked from gastonstat/r4strings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrepetitions.Rmd
16 lines (12 loc) · 869 Bytes
/
repetitions.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Repetition Patterns {#repetion}
## Introduction
In this chapter, you will learn how to use _repetition metacharacters_ to gain more
matching power in your regular expressions. We're going to start by looking at
the three main metacharacters: the star---or asterisk--- `*`, the plus `+`, and
the question mark `?`. Each one of these metacharacters has an effect on the token
that immediately precedes it. That token could be a literal character, it could be
a character set, or it could be a more complicated expression; a repetition
metacharacter takes that preceding token and determines how many times that token
can be repeated. In the case of the asterisk `*`, that token can be there 0 or
more times; in the case of the plus `+`, it would be there one or more times;
and with the question mark `?`, the token would just be there 0 time or one time.