没有合适的资源?快使用搜索试试~ 我知道了~
Mastering Regular Expressions (Third Edition)
5星 · 超过95%的资源 需积分: 10 7 下载量 47 浏览量
2013-04-13
21:38:42
上传
评论
收藏 2.37MB PDF 举报
温馨提示
试读
534页
精通正则表达式第三版,作者Jeffrey E. F. Friedl。 全英文,文字版,不喜勿下。
资源推荐
资源详情
资源评论
Mastering Regular Expressions
Third Edition
Jeffrey E. F. Friedl
Beijing
•
Cambridge
•
Farnham
•
Köln
•
Paris
•
Sebastopol
•
Taipei
•
Tokyo
,TITLE.7437 Page 3 Monday, July 24, 2006 10:11 AM
Mastering Regular Expressions, Third Edition
by Jeffrey E. F. Friedl
Copyright © 2006, 2002, 1997 O’Reilly Media, Inc. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly Media, Inc. books may be purchased for educational, business, or sales promotional use.
Online editions are also available for most titles (safari.oreilly.com). For more information contact
our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com.
Editor: Andy Oram
Production Editor: Jeffrey E. F. Friedl
Cover Designer: Edie Freedman
Printing History:
January 1997: First Edition.
July 2002: Second Edition.
August 2006: Third Edition.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks
of O’Reilly Media, Inc. Mastering Regular Expressions, the image of owls, and related trade dress
are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers
to distinguish their products are claimed as trademarks. Where those designations appear in this
book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed
in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author
assume no responsibility for errors or omissions, or for damages resulting from the use of the
information contained herein.
This book uses RepKover
™
, a durable and flexible lay-flat binding.
ISBN: 0-596-52812-4
[M]
,COPYRIGHT.7318 Page i Monday, July 24, 2006 10:11 AM
FOR
LM
Fumie
For putting up with me.
And for the years I worked on this book,
for putting up without me.
Ta b le of Contents
Preface .................................................................................................................. xvii
1: Introduction to Regular Expressions ...................................................... 1
Solving Real Problems ........................................................................................ 2
Regular Expressions as a Language ................................................................... 4
The Filename Analogy ................................................................................. 4
The Language Analogy ................................................................................ 5
The Regular-Expr ession Frame of Mind ............................................................ 6
If You Have Some Regular-Expr ession Experience ................................... 6
Searching Text Files: Egrep ......................................................................... 6
Egr ep Metacharacters .......................................................................................... 8
Start and End of the Line ............................................................................. 8
Character Classes .......................................................................................... 9
Matching Any Character with Dot ............................................................. 11
Alter nation .................................................................................................. 13
Ignoring Differ ences in Capitalization ...................................................... 14
Word Boundaries ........................................................................................ 15
In a Nutshell ............................................................................................... 16
Optional Items ............................................................................................ 17
Other Quantifiers: Repetition .................................................................... 18
Par entheses and Backrefer ences ............................................................... 20
The Great Escape ....................................................................................... 22
Expanding the Foundation ............................................................................... 23
Linguistic Diversification ............................................................................ 23
The Goal of a Regular Expression ............................................................ 23
vii
7July 2006 21:51
viii Table of Contents
AFew MoreExamples ............................................................................... 23
Regular Expression Nomenclature............................................................ 27
Impr oving on the Status Quo .................................................................... 30
Summary ..................................................................................................... 32
Personal Glimpses ............................................................................................ 33
2: Extended Introductor y Examples .......................................................... 35
About the Examples .......................................................................................... 36
AShort Introduction to Perl ...................................................................... 37
Matching Text with Regular Expressions ......................................................... 38
Toward a MoreReal-World Example ........................................................ 40
Side Effects of a Successful Match ............................................................ 40
Intertwined Regular Expressions ............................................................... 43
Inter mission ................................................................................................ 49
Modifying Text with Regular Expressions ....................................................... 50
Example: FormLetter ................................................................................. 50
Example: Prettifying a Stock Price ............................................................ 51
Automated Editing ...................................................................................... 53
ASmall Mail Utility ..................................................................................... 53
Adding Commas to a Number with Lookaround ..................................... 59
Text-to-HTML Conversion ........................................................................... 67
That Doubled-Word Thing ......................................................................... 77
3: Over viewofRegular Expression Features and Flavors ................ 83
ACasual Stroll Across the Regex Landscape ................................................... 85
The Origins of Regular Expressions .......................................................... 85
At a Glance ................................................................................................. 91
Car e and Handling of Regular Expressions ..................................................... 93
Integrated Handling ................................................................................... 94
Pr ocedural and Object-Oriented Handling ............................................... 95
ASearch-and-Replace Example ................................................................. 98
Search and Replace in Other Languages ................................................ 100
Car e and Handling: Summary ................................................................. 101
Strings, Character Encodings, and Modes ...................................................... 101
Strings as Regular Expressions ................................................................ 101
Character-Encoding Issues ....................................................................... 105
Unicode ..................................................................................................... 106
Regex Modes and Match Modes .............................................................. 110
Common Metacharacters and Features .......................................................... 113
7July 2006 21:51
剩余533页未读,继续阅读
资源评论
- 养乌龟的hx2014-08-20非常好的书,强烈推荐
- caipengxiang2014-09-13太喜欢这本书了,简直是宝啊
若等闲
- 粉丝: 4
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
- 林周瑜-论文.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功