qdapRegex is a collection of regex tools associated with the qdap package that may be useful outside of the context of discourse analysis. Tools include removal/extraction/replacement of emails addresses, person tags, hash tags, dollar amounts, percentages, times, zip codes, and phone numbers.

Download the development version of qdapRegex here

Help topics


Function for removing/extracting/replacing text using regular expressions.


Functions for testing regular expressions.

  • is.regex
    Test Regular Expression Validity
  • validate
    Regex Validation Function Generator


Functions used within qdapRegex that are intended for education around regular expressions.

  • cheat
    A Cheat Sheet of Common Regex Task Chunks
  • grab
    Grab Regular Expressions from Dictionaries
  • explain
    Visualize Regular Expressions

qdapRegex Tools

Other functions used within qdapRegex that are not specific to removing/extracting/replacing text with regular expressions.

  • bind
    Add Left/Right Character(s) Boundaries
  • bind_or
    Boundary Wrap (Bind) and `or` Concatenate Elements
  • grab
    Grab Regular Expressions from Dictionaries
  • group
    Group Regular Expressions
  • group_or
    Group Wrap and `or` Concatenate Elements
  • escape
    Escape Strings From Parsing
  • pastex %|%
    Paste Regular Expressions
  • %+%
    Paste Regular Expressions
  • S
    Use C-style String Formatting Commands
  • TC L U
    Upper/Lower/Title Case

Regular Expression Dictionaries

Data sets with canned regular expressions.

  • regex_cheat
    A dataset containing the regex chunk name, the regex string, and a
  • regex_usa
    Canned Regular Expressions (United States of America)
  • regex_supplement
    Supplemental Canned Regular Expressions


  • Imports: stringi
  • Suggests: testthat