O'Reilly logo

Data Analysis with R - Second Edition by Tony Fischetti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

What are regular expressions?

Regular expressions (or regexes, as it is commonly abbreviated) is a formal grammar for describing patterns in text/strings. In general purpose programming languages, it is often used for things like verifying user input, but it is most often used in the context of statistical programming to transform the textual representation of raw data. Regular expressions are—at once—the plural form of a single regular expression, a powerful tool, an idea, and a language for describing patterns in text.

You might ask yourself: How do I work with this? You might first ask yourself: How does regex help me with data analysis? I compute on numbers, not strings!

Well, first, there are often strings/character vectors in datasets ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required