Update 09.2.md (#650)

* Update 09.2.md

* Update 09.2.md
This commit is contained in:
marjune
2019-07-11 12:13:36 +08:00
committed by ᴊ. ᴄʜᴇɴ
parent fe83f75551
commit 4d3dde588d

View File

@@ -2,7 +2,7 @@
正则表达式语法和使用的详细信息请参考 [维基百科](http://en.wikipedia.org/wiki/Regular_expression)。
在下面的程序里,我们将在字符串中对正则表达式进行匹配。
在下面的程序里,我们将在字符串中对正则表达式模式pattern进行匹配。
如果是简单模式,使用 `Match` 方法便可:
@@ -16,7 +16,7 @@ ok, _ := regexp.Match(pat, []byte(searchIn))
ok, _ := regexp.MatchString(pat, searchIn)
```
更多方法中,必须先将正则通过 `Compile` 方法返回一个 Regexp 对象。然后我们将掌握一些匹配,查找,替换相关的功能。
更多方法中,必须先将正则模式通过 `Compile` 方法返回一个 Regexp 对象。然后我们将掌握一些匹配,查找,替换相关的功能。
示例 9.2 [pattern.go](examples/chapter_9/pattern.go)