Regular Expression Guide (2nd Edition)
Tags
Summary
Editor's review
The book's value lies in its distinctive "guide" positioning: it is not merely a syntax manual but stresses the design thinking and problem-solving patterns behind regular expressions. Through numerous cases drawn from realistic scenarios (such as text parsing, data extraction, and input validation), it gradually leads readers to understand how the regex engine works and to avoid common pitfalls. The second edition adds modern topics including Unicode, performance optimization, and differences in regular expression support across popular programming languages (such as Python, JavaScript, and Java), making the content better attuned to today's development environment.
From an editorial perspective, the book's standout strength is its balance: it both dissects the underlying logic of regular expressions (such as backtracking and greedy/lazy matching) and provides practical examples ready for immediate use. The chapters progress from shallow to deep, each ending with a summary and exercises, making it suitable for systematic study. For developers, test engineers, and data analysts who frequently process text or data, this book helps build solid regex thinking and improve both efficiency and code quality.
Who it's for
A good fit for
- Software developers who frequently need to extract, clean, or validate text
- Technical learners who want to master the principles of regular expressions systematically and avoid fragmented learning
- Data workers who need efficient pattern matching in scenarios such as data analysis and log processing
- Advanced users with a foundation who want to understand advanced features in depth (such as backtracking control and Unicode support)
Not a good fit for
- Light, casual users who only need simple find-and-replace and have no need for deep study
- Readers who expect to quickly master "universal regex formulas" without wanting to understand the underlying mechanisms
Reading tips
- Read the chapters in order, focusing on the core syntax and engine mechanisms in Chapters 2–4, which are the foundation for later application
- When practicing, tie the material to your own work scenarios and try adapting the book's cases to real tasks—for example, using regex to optimize existing scripts
- When reading Chapter 8, "Performance Optimization," use tools to test the matching efficiency of different formulations and deepen your understanding of backtracking issues
About the publisher
The Publishing House of Electronics Industry is a comprehensive publisher distinguished by its focus on electronic information and related fields. Judging from the more than 3,000 titles in its catalogue, its publishing covers programming and design, artificial intelligence, computer science, finance and economics, photography, and social sciences, attending both to cutting-edge technology and to general readers. Representative titles include Factor Investing: Methods and Practice, x86 Assembly Language: From Real Mode to Protected Mode, The RISC-V Reader, Artificial Intelligence: Speech Recognition, Understanding and Practice, Phased Array Radar Technology, Radar Target Characteristics, and 100 Go Mistakes and How to Avoid Them, most of which centre on technical methods and engineering practice. Its authors include Shi Chuan, Li Zhong, Wang Xiaobo, David Patterson, Andrew Waterman, and Yu Zihao, among others from China and abroad. Owing to limited public information, no further publishing features are elaborated here.
Contents
- 版权信息
- 内容简介
- 引子:关于正则表达式……
- 返璞归真——评《正则指引》
- 克制我们内心的冲动
- 前言
- 第一部分
- 第1章 字符组
- 1.1 普通字符组
- 1.2 关于Python的基础知识
- 1.3 普通字符组(续)
- 1.4 元字符与转义
- 1.5 排除型字符组
- 1.6 字符组简记法
- 1.7 字符组运算
- 1.8 POSIX字符组
- 第2章 量词
- 2.1 一般形式
- 2.2 常用量词
- 2.3 数据提取
- 2.4 点号
- 2.5 滥用点号的问题
- 2.6 忽略优先量词
- 2.7 转义
- 第3章 括号
- 3.1 分组
- 3.2 多选结构
- 3.3 引用分组
- 3.4 非捕获分组
- 3.5 补充
- 第4章 断言
- 4.1 单词边界
- 4.2 行起始/结束位置
- 4.3 环视
- 4.4 补充
- 第5章 匹配模式
- 5.1 不区分大小写模式与模式的指定方式
- 5.2 单行模式
- 5.3 多行模式
- 5.4 注释模式
- 5.5 补充
- 第6章 其他
- 6.1 转义
- 6.2 正则表达式的处理形式
- 6.3 表达式中的优先级
- 6.4 回车和换行
- 第二部分
- 第7章 Unicode
- 7.1 基础知识
- 7.2 关于编码
- 7.3 尽量使用Unicode编码
- 7.4 Unicode与字符组简记法
- 7.5 规范化问题
- 7.6 单词边界
- 7.7 码值转义序列
- 7.8 Unicode属性
- 7.9 Unicode属性列表
- 7.10 POSIX字符组
- 7.11 Emoji
- 第8章 匹配原理
- 8.1 有穷自动机
- 8.2 正则表达式的匹配过程
- 8.3 回溯
- 8.4 NFA和DFA
- 第9章 常见问题的解决思路
- 9.1 关于元素的三种逻辑
- 9.2 正则表达式的常见操作
- 9.3 正则表达式的优化建议
- 9.4 别过分依赖正则表达式
- 第三部分
- 第10章 .NET
- 10.1 预备知识
- 10.2 正则功能详解
- 10.3 正则API简介
- 10.4 常用操作示例
- 第11章 Java
- 11.1 预备知识
- 11.2 正则功能详解
- 11.3 正则API简介
- 11.4 常用操作示例
- 11.5 Java 8和Java 9的新改进
- 第12章 JavaScript
- 12.1 预备知识
- 12.2 正则功能详解
- 12.3 正则API简介
- 12.4 常用操作示例
- 12.5 关于ActionScript
- 第13章 PHP
- 13.1 预备知识
- 13.2 正则功能详解
- 13.3 正则API简介
- 13.4 常见的正则操作举例
- 第14章 Python
- 14.1 预备知识
- 14.2 正则功能详解
- 14.3 正则API简介
- 14.4 常用操作示例
- 第15章 Ruby
- 15.1 预备知识
- 15.2 正则功能详解
- 15.3 正则API简介
- 15.4 常用操作示例
- 15.5 Ruby 1.9的新变化
- 第16章 Objective-C
- 16.1 预备知识
- 16.2 正则功能详解
- 16.3 正则API简介
- 16.4 常用操作示例
- 第17章 Golang
- 17.1 预备知识
- 17.2 正则功能详解
- 17.3 正则API简介
- 17.4 常用操作示例
- 第18章 Linux/UNIX
- 18.1 POSIX
- 18.2 vi
- 18.3 grep
- 18.4 awk
- 18.5 sed
- 18.6 总结
- 附录A 常用语言中正则特性一览
- 附录B 常用的正则表达式
- 附录C 常用的正则表达式工具及资源
FAQ
Is this book suitable for complete beginners?
Which language are the code examples mainly in?
What important updates does the second edition have compared with the first?
Related on WeRead
Comments
Find this book
This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.
About the author
Yu Sheng is a Chinese author of technical books. Public information about him is limited, and his nationality, dates of birth and death, and educational background are not known. One of his works is held in the collection: Regular Expressions Guide (2nd Edition), a book commonly classified under programming and design. Judging from the subject, he focuses on regular expressions, a practical technology widely used in text processing and software development. His writing tends toward reference and learning guides, emphasizing conceptual clarity and rule explanation rather than general programming philosophy. The existence of a second edition indicates that the book has been revised and updated, suggesting continued relevance and reader demand. For readers who want to learn regular expressions systematically, such a work can serve as a reference for consultation and practice. Because no other information about the author is publicly available, a fuller picture of his work still requires more material.