Regular Expressions (Regex) in JavaScript - Part I

Regular Expressions are used to find a specific pattern within a big glob of text. Regular expressions are also known as regex or regexp among developers.

Read this post for how regular expressions are used in JavaScript methods.

In this post series i'm trying to give you an idea about how to create an regex that matches a particular string.

Very Basic Rules 

  1. Every regular expression literal starts and ends with a forward slash ("/").  
  2. Pattern that we are trying to match goes between those slashes.
  3. After end slash "g", "i", "m" characters can be used as flags. Each letter has different purposes.