New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty pattern-match modifiers should be documented #16413
Comments
From @chorobaCreated by @choroba"perlre" introduces the (?) construct with Zero or more embedded pattern-match modifiers, to be turned on (or But, in fact, it's possible to specify an empty list of modifiers. See http://www.perlmonks.org/?node_id=1208872 for more details. Patch to the documentation attached. Perl Info
|
From @chorobadiff --git a/pod/perlre.pod b/pod/perlre.pod -One or more embedded pattern-match modifiers, to be turned on (or |
From @jkeenanOn Sun, 11 Feb 2018 00:30:52 GMT, choroba@cpan.org wrote:
Assuming that this behavior is acceptable and should be documented as such, we should probably also add a unit test of the behavior. -- |
The RT System itself - Status changed from 'new' to 'open' |
From @demerphqHow are zero modifiers different from the empty list? Seems like this On 11 Feb 2018 02:13, "James E Keenan via RT" <perlbug-followup@perl.org>
|
From @Smylersdemerphq writes:
perlre in blead currently says “One or more”. The patch in this ticket I suspect that the reporter inadvertently copied the ‘current’ wording Smylers |
From @demerphqOn 12 Feb 2018 20:46, "Smylers" <smylers@stripey.com> wrote: demerphq writes:
perlre in blead currently says “One or more”. The patch in this ticket I suspect that the reporter inadvertently copied the ‘current’ wording Ah. Good catch. Well then let's fix the code here, not the doc. Yves |
From @demerphqOn 12 February 2018 at 15:00, demerphq <demerphq@gmail.com> wrote:
For example: $ git diff Inline Patchdiff --git a/regcomp.c b/regcomp.c
index 9d19d3e..49f1b71 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -10889,7 +10889,9 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32
-- |
From @iabynOn Tue, Feb 13, 2018 at 05:08:46AM +0100, demerphq wrote:
I think the point being made in the original perlmonks post was that This is particularly useful for dynamic patterns, such as those read And "dynamically generated" can easily result in zero flags. So the OP -- |
From @demerphqOn 13 Feb 2018 16:59, "Dave Mitchell" <davem@iabyn.com> wrote: On Tue, Feb 13, 2018 at 05:08:46AM +0100, demerphq wrote:
I think the point being made in the original perlmonks post was that This is particularly useful for dynamic patterns, such as those read And "dynamically generated" can easily result in zero flags. So the OP I'm fine either way but for the record I was thinking it should be Yved |
From @khwilliamsonOn Tue, 13 Feb 2018 03:09:29 -0800, demerphq wrote:
I'm in favor of catching typos (such as the one in the line above :) ) |
From @cpansproutOn Wed, 14 Mar 2018 09:21:38 -0700, khw wrote:
I would prefer that we keep it loose. It is longstanding behaviour, and fixing it provides little gain. (How likely is someone to type (?) by mistake without noticing it? If the ) was added by mistake the pattern won’t compile.) -- Father Chrysostomos |
From @demerphqOn 14 March 2018 at 17:45, Father Chrysostomos via RT
FWIW, I am not convinced. I can easily someone making this mistake, Yves -- |
From @khwilliamsonOn Wed, 14 Mar 2018 10:02:34 -0700, demerphq wrote:
Discussion here has stalled. Another option is to document and warn, but only under 're strict'. Then longstanding code will be unaffected, but there is a way for someone to find these. |
From @khwilliamsonGiven that 11 months have passed without comment on my latest proposal, I implemented it by applying E Choroba's patch, and making an empty (?) warn under re 'strict', and documenting that, adding a test in |
@khwilliamson - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.30.0, this and 160 other issues have been Perl 5.30.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#132851 (status was 'resolved')
Searchable as RT132851$
The text was updated successfully, but these errors were encountered: