Support capture groups with the RE/flex regex matcher?

Aperta
#95 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
cpp
Ambito
compilers

Direzione di ricerca

Inizia con il matcher regex RE-flex e la relativa documentazione, concentrandoti sul comportamento esistente dei gruppi non catturanti e sulle considerazioni di compatibilità indicate. Determina come dovrebbe essere esposto il supporto diretto ai gruppi di cattura e quale comportamento dimostrerebbe che RE-flex lo supporta senza Boost.Regex o PCRE2.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement question

Hello,

First off, I'm a huge fan of RE-flex for my projects and ugrep is by far my most valuable and most used tool at my workplace. I deal with a lot of text.

Out of all that usage, I consistently miss the capture group feature. I know it is supported with other regex libraries that RE-flex (and therefore ugrep) can use, but that is not the same as RE-flex supporting it directly. I love ugrep and RE-flex's speed and features, but it always hurts me that I have to compile with PCRE2 mode (-P) to get capture groups with ugrep and use Boost.Regex when directly using RE-flex. They're such a common thing to need--why does RE-flex not support them? I'd like to use it and only it so that I do not have to bother with Boost or PCRE2, and also for the performance benefits.

I know POSIX and other compatibility things are at play, but I don't see how supporting capture groups would violate them. The docs say that RE-flex supports the lazy quantifiers, which is not part of POSIX, and it also supports non-capturing groups, but not capture groups. Why is this? It seems like it would be easy to add support for capturing groups considering that non-capturing groups are supported. It makes me think there is some sort of design decision that has already been made which does not allow them, but I don't understand enough of the library to know what it is.

Thanks in advance for your patience if I am making an incorrect assumption or unaware of some functionality that would do this. I'm also sorry if this has already been addressed in another issue or in the docs, but I could not find it either here, ugrep's github project, or the docs.

Lingua principale
C++
Stelle
603
Fork
97
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Genivia/RE-flex

Tutte le issue di Genivia/RE-flex

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.