[pcre-dev] [Bug 2503] Documentation references a (?J) not ex…

Top Page
Delete this message
Author: admin
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 2503] Documentation references a (?J) not explained anywhere
https://bugs.exim.org/show_bug.cgi?id=2503

--- Comment #2 from php4fan@??? ---
>> So I searched for any occurrence of "?J" and it doesn't appear anywhere else.
>
> Not true:
>
> $ pcre2grep -l '\(\?J\)' doc/*


I meant I searched within that page. I didn't download the source and grep it
(also note there is no search tool to search throughout the whole docs).
If it's somewhere else I'd expect a link.

Admittedly, I landed to that page from a google search, and I see it's a
manpage of a particular command and not about pcre syntax in general, so that
may not be the page where to expect an explanation of how this particular
modifier/option, but then again, I would expect either a link to where it's
documented fully, or a link to where this kind of "modifiers" or whatever they
are called, i.e. "(?SOMETHING)" are documented.

> Well, there's not much to say. (?J) within a pattern
> sets the PCRE2_DUPNAMES option


There's at least one thing to be said: WHERE in the pattern one is supposed to
put it. This is not obvious to those of us who don't know this mechanism.
Usually parenthesis delimit a group/subpattern; things that modify the behavior
of the whole patters are usually at the end after the closing delimiter (i.e.
flags). I had never seen a self-contained "(?something)" thing that sets an
option for how the whole expression behaves. So, if I see it casually mentioned
in a piece of documentation that is discussing something else (in this case,
named subpatterns), and that seems to assume you already have to know what that
thing is, I expect a link to where the thing is documented in detail.

Adding it to the examples is not the full fix, but it's the bare minimum; now
at least we have that, that's a significant improvement.

--
You are receiving this mail because:
You are on the CC list for the bug.