Mastering Regular Expressions(精通正则表达式) 阅读笔记:第一章,概念
Real Scenario(现实场景)
Here's the scenario: you're given the job of checking the pages on a web server for doubled words (such as "this this"), a common problem with documents subject to heavy editing.
任务:检查文本中重复的单词(doubled words),比如 "this this"。
一些额外的要求:
- 接受任意数量的文件;
- 产生报告:包含文件名、行号、单词高亮;
- 处理跨行的单词;
- 忽略大小写;
- 忽略 html 标签,如
<B>very</B>
very。
Solving Real Problems(解决现实问题)
Knowing how to wield regular expressions unleashes processing powers you might not even know were available.
学会使用正则表达式可能为你带来前所未有的力量。