Backreferences

0th

Percentile

Backreferences

Backreferences for replacement operations. These are used by replacement functions such as sub and stri_replace_first_regex, and by the stringi and stringr match functions such as stri_match_first_regex.

Keywords
datasets
Usage
REF1

REF2

REF3

REF4

REF5

REF6

REF7

REF8

REF9

ICU_REF1

ICU_REF2

ICU_REF3

ICU_REF4

ICU_REF5

ICU_REF6

ICU_REF7

ICU_REF8

ICU_REF9

Format

An object of class regex (inherits from character) of length 1.

References

http://www.regular-expressions.info/backref.html and http://www.rexegg.com/regex-capture.html

See Also

capture, for creating capture groups that can be referred to.

Aliases
  • Backreferences
  • REF1
  • Backreferences
  • REF2
  • Backreferences
  • REF3
  • Backreferences
  • REF4
  • Backreferences
  • REF5
  • Backreferences
  • REF6
  • Backreferences
  • REF7
  • Backreferences
  • REF8
  • Backreferences
  • REF9
  • Backreferences
  • ICU_REF1
  • Backreferences
  • ICU_REF2
  • Backreferences
  • ICU_REF3
  • Backreferences
  • ICU_REF4
  • Backreferences
  • ICU_REF5
  • Backreferences
  • ICU_REF6
  • Backreferences
  • ICU_REF7
  • Backreferences
  • ICU_REF8
  • Backreferences
  • ICU_REF9
Examples
# For R's PCRE and Perl engines
REF1
REF2
# and so on, up to
REF9

# For stringi/stringr's ICU engine
ICU_REF1
ICU_REF2
# and so on, up to
ICU_REF9

# Usage
sub("a(b)c(d)", REF1 %R% REF2, "abcd")
stringi::stri_replace_first_regex("abcd", "a(b)c(d)", ICU_REF1 %R% ICU_REF2)
Documentation reproduced from package rebus.base, version 0.0-3, License: Unlimited

Community examples

Looks like there are no examples yet.