Leverage the power of regular expressions to create an engaging user experienceAbout This BookBuild and use patterns in JavaScript to solve real-world problemsSimplify complex validation processes by mastering the pattern language in RegexA step-by-step guide along with a lot of real-world examples to manipulate text and crunch data, in URLs, paths, markup, and so onWho This Book Is ForThis book is ideal for JavaScript developers and programmers who work with any type of user entry data and want sharpen their skills to become experts.
What You Will LearnStructure your patterns and model different types of constraintsClean and optimize code with Regex's processing powerSolve common use cases and situationsExtract different types of fields correctlyEmbed regular expressions both in your UI and on the backendEfficiently create guard clauses in your functions using patternsCreate blank capture groups to handle inconsistent dataCapture parts of a pattern in a group to display, replace, or use character sets to match charactersIn DetailRegular 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.