Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

or() with capture()

オープン
#32 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
tooling

調査の方向性

Start by reading the implementation of or() and compare its grouping behavior with the oneOf() implementation proposed in pull request #31. Reproduce the expression from the issue against "def" and verify that the completed change produces the expected regex and captures the match.

索引モデルが issue の本文から書いたものです。

説明

It seems to me that the following expression:

VerbalExpression testRegex = regex()
                .capture()
                .find("abc")
                .or("def")
                .build();

should evaluate to the regex: /(?:((?:abc)|(?:(?:def))))/, but instead it evaluates to: /(?:((?:abc))|(?:(?:def)))/. As a result, if we test this expression against the string "def" it produces a match but no group is captured. This happens because the implementation of or() closes any opening parenthesis it finds in the string that precedes it.

I don't know why or() was implemented this way, but I believe the implementation of oneOf() I propose in https://github.com/VerbalExpressions/JavaVerbalExpressions/pull/31 may fix this problem.

主要言語
Java
スター
2.6k
フォーク
243
平均マージ
26分
マージ済み PR(30日)
1

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

VerbalExpressions/JavaVerbalExpressions のほかの issue

VerbalExpressions/JavaVerbalExpressions の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。