Liste des Groupes | Revenir à cl awk |
El 11/4/25 a las 9:10, Janis Papanagnou escribió: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.
A 2-dimensional array is not strictly necessary. It could be possible to
keep the one dimensional array interface and use the same trick for
multidimensional arrays indices in Posix AWK. I.e., return a list of
matched values delimited by SUBSEP.
Les messages affichés proviennent d'usenet.