> For the complete documentation index, see [llms.txt](https://linuxstory.gitbook.io/advanced-bash-scripting-guide-in-chinese/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://linuxstory.gitbook.io/advanced-bash-scripting-guide-in-chinese/zheng-wen/part5/18_regular_expressions.md).

# 18.正则表达式

> *...the intellectual activity associated with software development is largely one of gaining insight.* *--Stowe Boyd*

目录

* [18.1 正则表达式简介](http://tldp.org/LDP/abs/html/x17129.html)
* [18.2 文件名替换](http://tldp.org/LDP/abs/html/globbingref.html)

为了充分利用shell脚本，您需要熟练掌握正则表达式。有一些在脚本中常用的特定的命令和工具，例如grep、expr、sed和awk，这些命令会解释和使用正则表达式。版本三的bash实现了它独特的正则匹配符：=\~。
