regexp - 正規表現

メソッドの構成

 Find(All)?(String)?(Submatch)?(Index)?

複数行 - mフラグ

 text := ` abc1
  xyz2`
 re := regexp.MustCompile(`(?m)^ (.+)$`)
 text = re.ReplaceAllString(text, "[$1]")
 fmt.Println("DEBUG:" + text)
 DEBUG:[abc1]
 [xyz2]

参考


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

Last-modified: 2014-07-18 (金) 19:57:48