Chapter 20. The RegExp Object: Working with Regular Expressions

The RegExp Object: Working with Regular Expressions

One of the powerful aspects of JavaScript is its capability to work with text. Ever since Internet Explorer 4.0 and Netscape Navigator 4.0, that has been augmented by being able to work with regular expressions. Regular expressions enable you to handle not only text strings as variables, but also work with the text content of those strings.

Using a regular expression, you can specify what kind of text substrings you want to match and work with. For example, here’s how I’m using the regular expression /[aeiou]/ to search text in a text field for vowels, and if any vowels are found, to ...

Get Inside JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.