Skip to content

Instantly share code, notes, and snippets.

@isayani
isayani / how-to-regex.md
Last active November 4, 2022 03:53
Regex has daunted programmers for far too long. Fear not! Check out the following gist to learn more about the powerful tool that is Regular Expressions.

Reg-What? A Guide to Regular Expressions

What is a Regex?

A Regular Expression or Regex is a sequence of characters specifying a search pattern in text. In other words, it is a shorthand for returning specific criterion in any programming language.

Regex can be useful when:

  • looking for a patterned-string in your code (like a phone or card number)
  • replacing an existing pattern with another
  • referencing string-based algortithms
  • input validation