0Pricing
R Academy · Lesson

Regular Expressions

Leverage pattern matching and substitution with regex for complex text handling tasks.

1

Introduction to Regular Expressions in R

Regular expressions (regex) allow you to match and manipulate text patterns efficiently. In this lesson, you'll learn the basics of using regex in R.

Regular Expressions — illustration 1

2

Using grep() to Find Patterns

The grep() function searches for patterns in a vector.

text <- c('apple', 'banana', 'cherry')
grep('a', text)

All lessons in this course

  1. String Manipulation
  2. Regular Expressions
  3. Dates and Times in R
← Back to R Academy