# 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) &#x20;
* [18.2 文件名替换](http://tldp.org/LDP/abs/html/globbingref.html) &#x20;

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.clay-wangzhi.com/shell/part5/18_regular_expressions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
