0

I'm working through Hadley Wickham's R for Data Science, and I struggle with regular expressions (which in some cases seems to quickly or not explained at all - despite the rest of the book being good).

I'm particular confused now by the following

"(.)(.)(.).*\3\2\1"

If I could understand this I think I would be in a good position. What does \3 mean and \2 mean?

user1778351
  • 143
  • 7
  • Also, [groups](http://www.regular-expressions.info/brackets.html) and [backreferences](http://www.regular-expressions.info/backref.html) are a must read. There are a lot of sources. – Wiktor Stribiżew Jun 21 '17 at 13:11
  • Plenty of good books on REs are available (go to amazon, search, sort by rating), and on the web (your favorite search engine will have indexed many many sites, go browse some). –  Jun 21 '17 at 13:15
  • \1 \2 \3 ... is a Backreference to the Subpattern. \1 is the first Subpattern (.). – Bernhard Jun 21 '17 at 14:03

0 Answers0