正则表达式基本上就是为进行文本处理而构建的一种小型的子语言,用来进行字符串的匹配和替换。
Regular expressions are basically a small sub-language built for text processing, used to match and replace strings of characters.
即使在这样一小段脚本中,您也可以找到一些参数扩展,包括长度、子字符串、模式匹配和模式替换。
You'll recognize several parameter expansions, including length, substring, pattern matching, and pattern replacement in even this short piece of script.
替换字符串可能包含对在之前的匹配中捕获的子序列的引用。
The replacement string may contain references to subsequences captured during the previous match.
应用推荐