Skip to content

Instantly share code, notes, and snippets.

View CQlove's full-sized avatar

CQlove CQlove

  • 02:16 (UTC -07:00)
View GitHub Profile

JC's Regex Tutorial

Regex is short for regular expression, and you may also see some people use RE to refer to that as well. This is a concept in computer science. By using this rule you can match the string. So that Regular expressions are often used to match, retrieve, and replace text that matches a pattern.

Summary

We will talk about the basic Regex components next. Hopefully you will understand /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/ after reading this tutorial. Just a reminder; if you want to use Regex in JavaScript, add / before Regex without space and add another / after Regex without space to let JS know you want to get string only.

Table of Contents