* 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

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS