How to use Regular Expression Regex


Regular Expressions (regex or regexp) are a very useful tool to identify specific patterns in any text, which helps to extract information regardless the format of the text.

Regex can be used to validate inputs, web scraping, finding specific strings in documents, syntax validation for compilers, and so many others examples.

Helpful resources

Regex editor to build and test: regular expression 101

Regex visualization tools to breakdown and understand:

  • RegExr
    • help you to understand exactly what is happening in the regex
  • Debuggex
    • when I already have a decent understanding of how to accomplish what I want and just want a simple way to edit & test, I think the interface is less busy for that case
  • Regulex
  • Regex-Vis

Regular expression syntax cheatsheet