Book description
Leverage the power of regular expressions to create an engaging user experience
In Detail
Regular expressions are patterns or templates that allow you to define a set of rules in a natural yet vague way, giving you the ability to match and validate text. Therefore, they have been implemented in nearly every modern programming language. JavaScript's implementation allows us to perform complex tasks with a few lines of code using regular expressions to match and extract data out of text.
This book starts by exploring what a pattern actually is and how regular expressions express these patterns to match and manipulate user data. You then move on to learning about the use of character classes to define a wild character match, a digit match, and an alphanumeric match. You will then learn to manipulate text and shorten data in URLs, paths, markup, and data exchange, as well as other advanced Regex features.
Finally, you will work through real-world examples, both in the browser and on the server side using Node.js.
What You Will Learn
Structure your patterns and model different types of constraints
Clean and optimize code with Regex's processing power
Solve common use cases and situations
Extract different types of fields correctly
Embed regular expressions both in your UI and on the backend
Efficiently create guard clauses in your functions using patterns
Create blank capture groups to handle inconsistent data
Capture parts of a pattern in a group to display, replace, or use character sets to match characters
Table of contents
-
JavaScript Regular Expressions
- Table of Contents
- JavaScript Regular Expressions
- Credits
- About the Authors
- About the Reviewers
- www.PacktPub.com
- Preface
- 1. Getting Started with Regex
- 2. The Basics
- 3. Special Characters
- 4. Regex in Practice
- 5. Node.js and Regex
- A. JavaScript Regex Cheat Sheet
- Index
Product information
- Title: JavaScript Regular Expressions
- Author(s):
- Release date: May 2015
- Publisher(s): Packt Publishing
- ISBN: 9781783282258
You might also like
book
Clean Code in JavaScript
Get the most out of JavaScript for building web applications through a series of patterns, techniques, …
book
Introducing Regular Expressions: JavaScript and TypeScript
This book is your easy-to-digest and concise guide to regular expressions in JavaScript, this book teaches …
video
Learning Regular Expressions
Regular expressions are a powerful tool that can help you to find, replace and format text …
book
Java 9 Regular Expressions
Solve real world problems using Regex in Java. About This Book Discover regular expressions and how …