Regular Expressions (Introduction to Statistical Computing)

Three-Toed Sloth 2014-01-06

Summary:

Lecture 21: Regular expressions. Why we need ways of describing patterns of strings, and not just specific strings. The syntax and semantics of regular expressions: constants, concatenation, alternation, repetition. Back-references and capture groups. Splitting on regular expressions. grep and grepl for finding matches. regexpr and gregexpr for finding matches, regmatches for extracting the matching substrings. regexec for capture groups. Examples of multi-stage processing with regular expressions. Examples of substitutions with regmatches, sub and gsub. Things you cannot do with regular expressions.

Examples: Lincoln's 2nd inaugural address; baking brownies with Ms. Alice B. Tolkas; extracting earthquake information from data files.

Readings: Matloff, chapter 11; R Cookbook, chapter 7; Spector, chapter 7. Optional readings: Bradnam and Korf, sections 4.26--4.28, 5.3, 6.1

Introduction to Statistical Computing

Link:

http://bactra.org/weblog/1078.html

From feeds:

Statistics and Visualization ยป Three-Toed Sloth

Tags:

Date tagged:

01/06/2014, 16:06

Date published:

01/06/2014, 16:06