python / python/cpython

Support set operations in regular expression character classes

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

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

stdlib topic-regex type-feature
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Feature or enhancement

Implement the set operations of Unicode Technical Standard #18 RL1.3 in re character classes, together with nested sets.

gh-74534 added FutureWarnings in Python 3.7 for the ambiguous constructs (--, &&, ~~, ||, and a leading [) as preparation for this syntax; this issue turns them into operators.

Two character sets are combined by an operator, where an operand may be a nested set in brackets:

  • [A--B] — difference: a character in A but not in B.
  • [A&&B] — intersection: a character in both A and B.
  • [A||B] — union: a character in A or B.
  • [A~~B] — symmetric difference: a character in A or B but not both.

Operators have no precedence and apply left to right; nested sets are used to group. A leading ^ complements the whole result.

For example, [a-z--[aeiou]] matches an ASCII lowercase consonant and [\w&&[a-z]] matches an ASCII lowercase letter.

Linked PRs
  • gh-152153
  • gh-152154
  • gh-152214
  • gh-153022

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

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

はじめの一歩

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

調査の方向性

まず、Python の re における文字クラスの処理と Unicode Technical Standard #18 RL1.3 を読んでください。列挙されている差、共通部分、和、対称差、入れ子、左から右への処理、補集合の各例に照らして完了を確認してください。

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

評価

技術スタック
python
領域
tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
25/100

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

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