YanoRyuichi.com/
Wiki
Blog
GitHub
Sandbox
開始行:
* regexp - 正規表現 [#u71a395d]
** メソッドの構成 [#k454bf7b]
Find(All)?(String)?(Submatch)?(Index)?
** 複数行 - mフラグ [#o05dae33]
text := ` abc1
xyz2`
re := regexp.MustCompile(`(?m)^ (.+)$`)
text = re.ReplaceAllString(text, "[$1]")
fmt.Println("DEBUG:" + text)
DEBUG:[abc1]
[xyz2]
** 参考 [#i445962d]
- http://golang.org/pkg/regexp/
- http://swtch.com/~rsc/regexp/regexp3.html
終了行:
* regexp - 正規表現 [#u71a395d]
** メソッドの構成 [#k454bf7b]
Find(All)?(String)?(Submatch)?(Index)?
** 複数行 - mフラグ [#o05dae33]
text := ` abc1
xyz2`
re := regexp.MustCompile(`(?m)^ (.+)$`)
text = re.ReplaceAllString(text, "[$1]")
fmt.Println("DEBUG:" + text)
DEBUG:[abc1]
[xyz2]
** 参考 [#i445962d]
- http://golang.org/pkg/regexp/
- http://swtch.com/~rsc/regexp/regexp3.html
ページ名: