Text Processing with JavaScript: Regular Expressions, Tools, and Techniques for Optimal Performance
Author: Faraz K. Kelhini (Author)
Publisher finelybook 出版社: Pragmatic Bookshelf
Edition 版次: 1st
Publication Date 出版日期: 2024-01-23
Language 语言: English
Print Length 页数: 242 pages
ISBN-13: 9798888650332
Book Description
You might think of regular expressions as the holy grail of text processing, but are you sure you aren’t just shoehorning them in where standard built-in solutions already exist and would work better? JavaScript itself provides programmers with excellent methods for text manipulation, and knowing how and when to use them will help you write more efficient and performant code. From extracting data from APIs to calculating word counts and everything in between, discover how to pick the right tool for the job and make the absolute most of it every single time.
Whether you’re a beginner or an advanced programmer, this up-to-date guide will save you a ton of time when dealing with text. With Text Processing with JavaScript, you’ll find a collection of tiny programs, each demonstrating a string manipulation approach in JavaScript. You’ll also focus squarely on the practical aspects of text processing with JavaScript – that is, what each technique is designed to accomplish and how to use it in your program.
Discover how to extract data from APIs and web pages, apply spelling corrections, convert and format currencies, and remove HTML tags from text. Learn to intersect tables, copy text to the clipboard, extract lists from text, and highlight sentences that contain a specific word. Find duplicate words and fix them automatically, modify a copy of an existing regex literal, match the beginning or end of a string, and remove all comments from JavaScript and HTML files with ease. Match non-ASCII words, calculate the word count of an article in any language, and more.
Become a JavaScript expert and master chef of text processing with this collection of hands-on and production-ready recipes.
Review
➤ Karl Stolley
Web developer and author of Programming WebRTC
A wealth of JavaScript tips, tricks, and tools,
Text Processing with JavaScript is loaded with recipes ranging from password validation to internationalization to simply working with formatted numbers. Faraz shows you the built-in functions you can use to tackle your JS problems, then expands to regular expressions for any complex situations you may face.➤ Michael Fazio
Engineering Manager at Albert and author of Kotlin and Android Development featuring Jetpack
There’s nothing regular about working with regular expressions. Turn the mundane yet tedious task of processing textual data into a manageable and even a fun experience using the techniques and recipes in this book.
➤
Award-winning author and founder of Agile Developer, Inc
A handful of domain-specific languages exist that richly reward the software developers who master them. For DevOps engineers, the key DSL is bash; for backend engineers, it’s SQL; and for frontend and full-stack engineers, it’s regular expressions. Expertly wielding any of these languages is a superpower.
Text Processing with JavaScript showcases how to harness the power of the JavaScript string type, diving deeply into all its aspects. Even developers with years of JavaScript experience will discover something new in its pages. With detailed coverage of various native text processing APIs, meticulous examples of regular expression techniques, and insightful code explanations, this book deserves a place on every frontend developer’s bookshelf.➤ Matt Frisbie
Author of Professional JavaScript for Web Developers
This book helps readers master text processing through its comprehensive knowledge, abundant real-world examples, and detailed explanations. I’d recommend it to anyone who wants to learn and delve deeper into text processing with JavaScript.
➤
The creator of Regex Vis