We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-P
現時点で-P (Perlの正規表現を使う) オプションの実質的な意味がありません。
regexp.Comple() はそもそもPerlとして正規表現をコンパイルしています。 https://github.com/golang/go/blob/release-branch.go1.5/src/regexp/regexp.go#L118 (Compileの実装) https://github.com/golang/go/blob/release-branch.go1.5/src/regexp/regexp.go#L152-L161 (Compileが呼び出している compile で syntax.Parse と syntax.Compile を実行している)
regexp.Comple()
Compile
compile
syntax.Parse
syntax.Compile
なので事前に syntax.Parse や Compile を実施する意味は、実質的に、まったくありません。
かといって差別化のために CompilePOSIX (ERE相当) を使うと、 こちらは ignorecase が使えなくなったり、オプションの説明と食い違ってしまったりします。
CompilePOSIX
ignorecase
またタイトルとは異なりますが -G オプションも、現在実質的な意味がないように見受けられます。 (basic が定義されているが、使われていないようなので)
-G
basic
1つの案として、こんなのが考えられますが、なんかいまいちしっくり来ません。
-E
regexp.CompilePOSIX
regexp.Compile
The text was updated successfully, but these errors were encountered:
どれも experimental のまま放置した機能なので削っていいかと思います。
Sorry, something went wrong.
No branches or pull requests
現時点で
-P
(Perlの正規表現を使う) オプションの実質的な意味がありません。regexp.Comple()
はそもそもPerlとして正規表現をコンパイルしています。https://github.com/golang/go/blob/release-branch.go1.5/src/regexp/regexp.go#L118 (
Compile
の実装)https://github.com/golang/go/blob/release-branch.go1.5/src/regexp/regexp.go#L152-L161 (
Compile
が呼び出しているcompile
でsyntax.Parse
とsyntax.Compile
を実行している)なので事前に
syntax.Parse
やCompile
を実施する意味は、実質的に、まったくありません。かといって差別化のために
CompilePOSIX
(ERE相当) を使うと、こちらは
ignorecase
が使えなくなったり、オプションの説明と食い違ってしまったりします。またタイトルとは異なりますが
-G
オプションも、現在実質的な意味がないように見受けられます。(
basic
が定義されているが、使われていないようなので)1つの案として、こんなのが考えられますが、なんかいまいちしっくり来ません。
-G
,-P
オプションは廃止-E
オプションを新設するregexp.CompilePOSIX
を使用し ERE 相当の動作とする。-E
が指定されなかった場合には、regexp.Compile
を使って BRE 相当の動作とするThe text was updated successfully, but these errors were encountered: