meaning less `-P` option
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 144
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
現時点で-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 相当の動作とする
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the current handling of the -G, -P, and proposed -E options, then compare it with the referenced Go regexp and syntax implementations. The issue presents several alternatives but does not decide which behavior or interface should replace them. Done would require an agreed option design and corresponding behavior checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100