Regular expressions is a powerful tool in any language. Learn the basics of using regular expressions / regex in your JavaScript applications. What is a Regular Expression or Regex? Explain JavaScript Regular Expression modifiers with examples Javascript Web Development Object Oriented Programming The JavaScript regular expression modifiers are optional part of a regular expression and allow us to perform case insensitive and global searchers. 1. In this case, the returned item will have additional properties as described below. The cheatsheet and examples presented in this post are based on contents of this book. JavaScript RegExp book Visit my repo learn_js_regexp for details about the book I wrote on JavaScript regular expressions. The syntax of a RegEx is the following: Using regular expressions, you can perform pattern searches, in addition to functions which search-and-replace text. In JavaScript, regular expressions like Strings are objects. Write a JavaScript program to test the first character of a string is uppercase or not. For me it always takes a few minutes until I understand what a particular regular expression does but there is no question about their usefulness. Creating a Regular Expression. An Array whose contents depend on the presence or absence of the global (g) flag, or null if no matches are found. It helps you to find a match in a string and can be used in different JavaScript functions (but also with other programming languages). I have jotted down a quick post on a Basic JavaScript Regular Expression Example to give beginners out there a taste of the power of using Regex in jQuery/JavaScript. For example, the Hello World regex matches the "Hello World" string.. (dot) is another example for a regular expression. For example, [a-z] denotes all lower case letters. The preceding example uses a regular expression to look for an exact match of the string “JavaScript”. Go to the editor Click me to see the solution. JavaScript Form Validation: Removing Spaces and Dashes. Example code of Email regex JavaScript Simple complete HTML example of JavaScript code to validate an email id :- In this example using input fields for email address and button for click.