aboutsummaryrefslogtreecommitdiffstats
path: root/man/man3/regex.3
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2025-08-23 21:40:10 +0200
committerAlejandro Colomar <alx@kernel.org>2025-09-07 11:14:35 +0200
commit17fa7e849eb524eeda51beadc9924527358722bb (patch)
treeb7a0e00134670e1c4d7059ac3ae46ae8e149564b /man/man3/regex.3
parentddb26eb2011a498ece999aa44e501e0ed7fddb09 (diff)
downloadman-pages-17fa7e849eb524eeda51beadc9924527358722bb.tar.gz
man/: Address diagnostic about mismatched quotes
Most of these are false positives, in the sense that a line break is escaped, and the matching quote is in the next source line. However, let's remove those escaped line breaks, which make reading the source more difficult. For this, rename some parameters to be shorter, and allow some lines to go slightly past the 80-column right margin. Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'man/man3/regex.3')
-rw-r--r--man/man3/regex.317
1 files changed, 8 insertions, 9 deletions
diff --git a/man/man3/regex.3 b/man/man3/regex.3
index 6c37ecafe8..21e9c4c0b7 100644
--- a/man/man3/regex.3
+++ b/man/man3/regex.3
@@ -15,10 +15,9 @@ Standard C library
.P
.BI "int regcomp(regex_t *restrict " preg ", const char *restrict " regex ,
.BI " int " cflags );
-.BI "int regexec(const regex_t *restrict " preg \
-", const char *restrict " string ,
-.BI " size_t " nmatch ", \
-regmatch_t " pmatch "[_Nullable restrict " nmatch ],
+.BI "int regexec(const regex_t *restrict " preg ,
+.BI " const char *restrict " string ,
+.BI " size_t " n ", regmatch_t " pmatch "[_Nullable restrict " n ],
.BI " int " eflags );
.P
.BR "size_t regerror(" "size_t errbuf_size;"
@@ -64,7 +63,7 @@ Thus, a value of
.I preg->re_nsub
+ 1
passed as
-.I nmatch
+.I n
to
.BR regexec ()
is sufficient to capture all matches.
@@ -97,7 +96,7 @@ will use only
for
.BR REG_STARTEND ,
ignoring
-.IR nmatch .
+.IR n .
.TP
.B REG_NEWLINE
Match-any-character operators don't match a newline.
@@ -165,7 +164,7 @@ If any matches are returned
wasn't passed to
.BR regcomp (),
the match succeeded, and
-.I nmatch
+.I n
> 0), they overwrite
.I pmatch
as usual, and the match offsets remain relative to
@@ -183,7 +182,7 @@ obtain the locations of matches within
.IR string :
.BR regexec ()
fills
-.I nmatch
+.I n
elements of
.I pmatch
with results:
@@ -192,7 +191,7 @@ corresponds to the entire match,
.I pmatch[1]
to the first subexpression, etc.
If there were more matches than
-.IR nmatch ,
+.IR n ,
they are discarded;
if fewer,
unused elements of