Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: JavaScript regular expressions guide Tutorial

Regular expressions are a powerful tool for performing pattern matches in Strings in JavaScript.

Tutorial Details:

JavaScript regular expressions guide

Regular expressions are a powerful tool for performing pattern matches in Strings in JavaScript. You can perform complex tasks that once required lengthy procedures with just a few lines of code using regular expressions. Regular expressions are implemented in JavaScript in two ways:

Literal syntax:

//match all 7 digit numbers
var phonenumber= /\d{7}/

Dynamically, with the RegExp() constructor:

//match all 7 digit numbers (note how "\d" is defined as "\\d")
var phonenumber=new RegExp("\\d{7}", "g")

The RegExp() method allows you to dynamically construct the search pattern as a string, and is useful when the pattern is not known ahead of time.

The backslash (\) is also used when you wish to match a special character literally. For example, if you wish to match the symbol "$" literally instead of have it signal the end of the string, backslash it: /\$/


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
JavaScript regular expressions guide Tutorial

View Tutorial:
JavaScript regular expressions guide Tutorial

Related Tutorials:

JavaWorld Developer Tools Guide: IDE
JavaWorld Developer Tools Guide: IDE
 
JavaWorld Developer Tools Guide: Testing Tools
JavaWorld Developer Tools Guide: Testing Tools
 
JavaWorld Developer Tools Guide: Compiler, Code Management
JavaWorld Developer Tools Guide: Compiler, Code Management
 
JavaWorld Developer Tools Guide
JavaWorld Developer Tools Guide
 
JavaWorld Developer Tools Guide: Virtual Machine
JavaWorld Developer Tools Guide: Virtual Machine
 
Matchmaking with regular expressions - JavaWorld July 2001
Matchmaking with regular expressions - JavaWorld July 2001
 
JSP Standard Tag Library eases Webpage development
JSP Standard Tag Library eases Webpage development
 
The Java Web Services Tutorial
This tutorial is a beginner\'s guide to developing Web services and Web applications using the Java Web Services Developer Pack (Java WSDP).
 
The J2EE 1.4 Tutorial
The J2EE 1.4 Tutorial is a guide to developing enterprise applications for the Java 2 Platform, Enterprise Edition (J2EE) version 1.4. Here we cover all the things you need to know to make the best use of this tutorial.
 
Joott Quick Start Guide
Joott Quick Start Guide JooTemplates is a templating system to generate business documents, such as forms, mailings and reports. It is being developed with the following aims
 
The JavaTM Web Services Tutorial
A beginner's guide to developing Web services and Web applications on the Java Web Services Developer Pack
 
JSP Tutorial
Adding dynamic content via expressionsAs we saw in the previous section, any HTML file can be turned into a JSP file by changing its extension to .jsp. Of course, what makes JSP useful is the ability to embed Java. Put the following text in a file wit
 
Java RMI Tutorial
This is a brief introduction to Java Remote Method Invocation (RMI). Java RMI is a mechanism that allows one to invoke a method on an object that exists in another address space.The other address space could be on the same machine or a different one. The
 
Device Driver Tutorial for the Solaris OS
Make your hardware work with the Solaris OS on x86 or SPARC architectures. If you are a beginning Solaris kernel programmer, start with this new tutorial on docs.sun.com.
 
Parsing an XML Document with XPath
The getter methods in the org.w3c.dom package API are commonly used to parse an XML document. But J2SE 5.0 also provides the javax.xml.xpath package to parse an XML document with the XML Path Language (XPath) .
 
Domain Registration Guide
Domain Registration Guide Domain Name Registrations Domain Name Registration Guide This guide is a must for any one wants to register domains.
 
Welcome to the Jboss 3.0 Tutorial
Welcome to the Jboss 3.0 Tutorial Welcome to the Jboss 3.0 Tutorial 10 Minutes Guide to Ant Comprehensive description of Ant with example. Building Web Application With Ant and Deploying on Jboss 3.0 This lesson shows you how to build you web
 
Introduction to the JSP Java Server Pages
Introduction to the JSP Java Server Pages Welcome to JSP Section Introduction To JSP Java Server Pages or JSP for short is Sun's solution for developing dynamic web sites. JSP provide excellent server side scripting support for creating database
 
Beginner to advance guide to the Apache Struts
Beginner to advance guide to the Apache Struts The Complete Apache Struts Tutorial This complete reference of Jakarta Struts shows you how to develop Struts applications using ant and deploy on the JBoss Application Server. Ant script is provided
 
Struts Guide
Struts Guide Struts Guide This tutorial is extensive guide to the Struts Framework. In this tutorial you will learn how to develop robust application using Jakarta Struts Framework. This tutorial assumes that the reader is familiar with the web
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.