Regular Expressions In JavaScript

In my first post regarding Regular Expressions (regex), we discussed the basic syntax of regex, its importance and how they are used along with a few examples. I strongly recommend reading that post first if you are completely unfamiliar with regex. Otherwise, lets move on.

This tutorial will not cover what regex are, what are their benefits and the basic syntax. For that refer to my previous post. But this tutorial will

Regular Expressions For Beginners: Lesson 1

A regular expression defines a search pattern for strings. This pattern may match one or several times or not at all for a given string. The abbreviation for regular expression is regex.

Regular expressions can helps in

  • Searching and pattern matching
  • Text replacement
  • Collecting information ( word count, no. of spaces, no. of lines)
  • Available in almost all languages (Perl, PHP, Java, .Net, JavaScript)
  • Many default operating system programs support regex ( grep, windows search). Some other programs like syntax highlighters and Eclipse Search also use regex power.

Continue reading Regular Expressions For Beginners: Lesson 1