O'Reilly logo

JavaScript: Visual QuickStart Guide, Eighth Edition by Dori Smith, Tom Negrino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7. Forms and Regular Expressions

In This Chapter

Validating an Email Address with Regular Expressions 173

Validating a File Name 178

Extracting Strings 180

Formatting Strings 183

Formatting and Sorting Strings 187

Formatting and Validating Strings 189

Replacing Elements using Regular Expressions 192

Regular expressions are an amazingly powerful way to validate and format text strings. Using regular expressions, you can write a line or two of JavaScript code that can accomplish tasks that otherwise would have taken several dozen lines.

A regular expression (often abbreviated as RegExp or called by its synonym grep) is a pattern, written using special symbols, which describes one or more text strings. You use regular expressions to match patterns ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required