Regular Expressions in R
📖 Scenario: You work in a small library. You have a list of book titles mixed with some extra text. You want to find which titles mention the word "data" in any form.
🎯 Goal: Build a simple R program that uses regular expressions to find and print book titles containing the word "data".
📋 What You'll Learn
Create a character vector called
books with given titlesCreate a regular expression pattern variable called
patternUse
grep() with pattern on books to find matching titlesPrint the matching titles using
print()💡 Why This Matters
🌍 Real World
Libraries, bookstores, or data analysts often need to search text data for keywords quickly and accurately.
💼 Career
Knowing regular expressions and text search functions in R is useful for data cleaning, text mining, and report generation.
Progress0 / 4 steps