JavaScript Regex Cheat Sheet
tuts+ -

Successfully working with regular expressions requires you to know what each special character, flag and method does. This is a regular expressions cheat sheet which you can refer to when trying to remember how a method, special character or flag works.

Defining a Regular Expression in JavaScript

There are two ways of defining a regular expression in JavaScript.

var rgx = /^(\d+)/ — You can use a regular expression literal and enclose the pattern between slashes. This is evaluated at compile...


Related Articles