Home arrow JavaScript arrow Understanding the JavaScript RegExp Object

Understanding the JavaScript RegExp Object

Need to match and replace patterns on a Web page? You don't need Perl or PHP - JavaScript can do the job just as well. In this article, find out how, with an introduction to the JavaScript RegExp object and its methods. After reading this tutorial, I'm pretty sure you're going to look at JavaScript in a different light. The language ins't the one most commonly associated with image swaps and browser detection, but it serves as a powerful tool to help you execute pattern-matching tasks in the client quickly and efficiently.

  1. Understanding the JavaScript RegExp Object
  2. Enter the Matrix
  3. Two to Tango
  4. Game, Set, Match
  5. Search and Destroy
  6. In Splits
  7. Objects in the Rear-View Mirror
  8. One Mississippi, Two Mississippi...
  9. Changing Things Around
  10. Working with Forms
  11. Over And Out
By: Harish Kamath, (c) Melonfire
Rating: starstarstarstarstar / 144
February 09, 2004

print this article



The Real World

Most Real Programmers treat JavaScript like the poor cousin from the country - useful in certain situations, but not very important. Real Programmers aren't interested in a language whose primary application seems to be swapping one image with another, or drawing mouse trails across a Web page. Real Programmers have better things to do.

Well, all you Real Programmers out there better hang on to your hats - JavaScript may only be confined to the client side of a Web transaction, but in that territory, it's the undisputed king. No other language is so easy to learn, or allows you to do quite so many things with minimum fuss. And one of the things it lets you do - quite well - is use regular expressions in your code.

Over the course of this article, I'm going to give you a gentle introduction to the concept of regular expressions in the context of JavaScript. I'll be showing you how to use JavaScript's String object for basic string matching and replacing capabilities, as well as more complex string manipulation. And I'll introduce you to the RegExp object, which provides a handy way to create more efficient code for common client-side input validation. So come on in; regardless of whether you're a Real Programmer or just trying to be one, you're sure to find something useful inside.

>>> More JavaScript Articles          >>> More By Harish Kamath, (c) Melonfire

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Javascript for Beginners: An Introduction
- Introduction to JavaScript
- Adding Elements to a Tree with TreeView jQue...
- Using the Persist Argument in a TreeView jQu...
- Using Unique and Toggle in a TreeView jQuery...
- Using Event Delegation for Mouseover Events ...
- Using the Animate Option in a Treeview jQuer...
- Using HTML Lists with Event Delegation in Ja...
- Opened and Closed Branches on a TreeView jQu...
- Mouseover Events and Event Delegation in Jav...
- Creating a TreeView JQuery Hierarchical Navi...
- Event Delegation in JavaScript
- A Look at the New YUI Carousel Control
- Working with Draggable Elements and Transpar...
- Displaying Pinned Handles with Resizable Con...

Developer Shed Affiliates


Dev Shed Tutorial Topics: