Re: Experiences with match() subexpressions?

Liste des GroupesRevenir à cl awk 
Sujet : Re: Experiences with match() subexpressions?
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.awk
Date : 11. Apr 2025, 08:10:55
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vtafa1$vfhn$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 11.04.2025 08:33, Aharon Robbins wrote:
In article <vt9dre$3t3po$1@dont-email.me>,
Janis Papanagnou  <janis_papanagnou+ng@hotmail.com> wrote:
The feature can be very useful,
but not for the case I was looking for. - Actually, it could have
provided the functionality I was seeking, but since GNU Awk relies
on the GNU regexp functions as they are implemented I cannot expect
that any provided features gets extended by Awk. - If GNU Awk would
have an own RE implementation then we could think about using, e.g.,
another array dimension to store the (now only temporary existing,
and generally unavailable) subexpressions.
 
Actually, this is not so trivial.  The data structures at the C level
as mandated by POSIX are one dimensional; the submatches in parentheses
are counted from left to right. There's no way to represent the
subexpressions that are under control of interval expressions, which
would essentially require a two-dimensional data structure.

Yes, that's why I had thought about a 2-dimensional array [on GNU
Awk level] so that arr[n][i] for i=1..z would contain the patterns.
This is what I actually tried with GNU Awk (before I had asked you)
to see whether there's some undocumented feature.

(I'm aware that things may get quite complicated if there's some
restrictions imposed (on "C"-level or else) which are in the way.)

 
Mike Haertel is writing a new regexp matcher for gawk; it was announced
here some time agao: https://github.com/mikehaertel/minrx. The code is
in the feature/minrx branch of the gawk Git repository.
 
I just opened an issue, https://github.com/mikehaertel/minrx/issues/43,
about this question. We shall see what develops.

Oh, thanks for that. - My expectation had just been to check whether
such a feature is already available in GNU Awk (or could in a simple
way be made available with little effort). So I'm indeed interested
to hear whether that is a feasible and sensible feature. - Myself,
I have to admit, haven't yet thoroughly thought through about such a
feature. I've just seen it from the limited view of my application
context and thought it could be a worthwhile extension/generalization.

Janis

 
Arnold
 


Date Sujet#  Auteur
10 Apr 25 * Experiences with match() subexpressions?22Janis Papanagnou
10 Apr 25 `* Re: Experiences with match() subexpressions?21Janis Papanagnou
10 Apr 25  +* Re: Experiences with match() subexpressions?14Kenny McCormack
10 Apr 25  i`* Re: Experiences with match() subexpressions?13Janis Papanagnou
10 Apr 25  i `* Re: Experiences with match() subexpressions?12Kenny McCormack
10 Apr 25  i  `* Re: Experiences with match() subexpressions?11Janis Papanagnou
11 Apr 25  i   `* Re: Experiences with match() subexpressions?10Aharon Robbins
11 Apr 25  i    +* Re: Experiences with match() subexpressions?5Janis Papanagnou
11 Apr 25  i    i+- Re: Experiences with match() subexpressions?1Kaz Kylheku
18 Apr 25  i    i`* Re: Experiences with match() subexpressions?3Manuel Collado
18 Apr 25  i    i +- Re: Experiences with match() subexpressions?1Kenny McCormack
18 Apr 25  i    i `- Re: Experiences with match() subexpressions?1Janis Papanagnou
11 Apr 25  i    +- Re: Experiences with match() subexpressions?1Kaz Kylheku
11 Apr 25  i    +* The new matcher (Was: Experiences with match() subexpressions?)2Kenny McCormack
11 Apr 25  i    i`- Re: The new matcher (Was: Experiences with match() subexpressions?)1Janis Papanagnou
11 Apr 25  i    `- Re: Experiences with match() subexpressions?1Kaz Kylheku
11 Apr 25  `* Re: Experiences with match() subexpressions?6Ed Morton
13 Apr 25   `* Re: Experiences with match() subexpressions?5Ed Morton
14 Apr 25    `* Nitpicking the code (Was: Experiences with match() subexpressions?)4Kenny McCormack
14 Apr 25     `* Re: Nitpicking the code (Was: Experiences with match() subexpressions?)3Janis Papanagnou
15 Apr 25      `* Re: Nitpicking the code (Was: Experiences with match() subexpressions?)2Ed Morton
15 Apr 25       `- Re: Nitpicking the code (Was: Experiences with match() subexpressions?)1Janis Papanagnou

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal