Support set operations in regular expression character classes
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
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 inAbut not inB.[A&&B]— intersection: a character in bothAandB.[A||B]— union: a character inAorB.[A~~B]— symmetric difference: a character inAorBbut 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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia leggendo la gestione delle classi di caratteri di re di Python e il Unicode Technical Standard #18 RL1.3. Conferma il completamento usando gli esempi elencati di differenza, intersezione, unione, differenza simmetrica, annidamento, valutazione da sinistra a destra e complemento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 25/100