Documentation
¶
Overview ¶
Package regexpop -- 正規表現についてのサンプルが配置されているパッケージです。
Goのregexpパッケージは、他の言語の正規表現ライブラリと比べて遅いと言われている。 理由は、安全性と予測可能性を優先した設計となっているため。 実装は RE2 系で、最悪ケースでも線形時間に収まるようにしている。 つまり、指数爆発を避ける設計となっている。
基本的に、多くのケースでは Go の regexp は十分速い。
Goにおける文字列処理の基本は
- 正規表現はループ内で毎回 MustCompile しない。
- 単純な判定なら strings.Contains や HasPrefix を優先する。
- 抽出対象が決まっているなら regexp よりパース処理のほうが速くて読みやすいことが多い。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRegister ¶
NewRegister -- このパッケージ用のサンプルを登録する mapping.Register を生成します。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.