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
Missing warning for /[[:digit]]/ #5305
Comments
From @AbigailCreated by @Abigail $ /opt/bleadperl/bin/perl -wle 'print "Found" if "9" =~ /[[:digit]]/' The missing ':' causes Perl to think you want the equivalent of /[[:dgit]/. Abigail Perl Info
|
From @jhiTo satisfy Robert's jugu^Wregular expression :-)
-- |
From @jkeenanOn Thu Nov 28 14:03:37 2002, jhi wrote:
Abigail, Jarkko: This ticket was last commented on nearly ten years ago. Is there still Thank you very much. |
From @jkeenanOn Sun Oct 21 16:17:30 2012, jkeenan wrote:
We've heard nothing about this ticket since my last post in October. I propose we close this ticket in 14 days unless someone objects *and* Thank you very much. |
From @jhiOn Monday-201301-14 19:39, James E Keenan via RT wrote:
I CCed Karl since he's pretty much the Regex Imperator now.
|
From @bulk88On Mon Jan 14 16:39:24 2013, jkeenan wrote:
The warning sounds useful from a superficial read. I am not going to -- |
From @khwilliamsonI thought I had commented on this. I think it would have been fixed if But the new (?[ ]) experimental syntax already tests for this particular |
From @jkeenanOn Mon Jan 14 20:47:08 2013, khw wrote:
Well, since there are still a variety of opinions being expressed, I |
From @khwilliamsonAs mentioned in the messages above, we are unlikely to add this message that might break long-standing behavior for regular bracketed character classes. However, the extended bracketed classes (?[ ]) already do the requested check. This is an experimental feature, which may become non-experimental as soon as 5.22. Hence, I am marking this as stalled and adding to the blockers for 5.22. If the feature remains experimental, this ticket can be moved to a later release. Otherwise, we close the ticket when 5.22 ships, as the core will then have the requested behavior available |
@khwilliamson - Status changed from 'open' to 'stalled' |
From @rjbsI have un-blocker-ed this. It is true that a facility that improves on the state of things is in 5.22, even if it is now still experimental. On the other hand, I *do* think this is a place to consider adding a new warning. I know several people who were bitten by this mistake in the last year alone. Obviously, this is pure anecdote, but we should consider whether there is a pattern on which we'd warn, to improve the "unknown posix class" warning condition. I don't know how we go about parsing this, but if [[:askii:]] warns, then why not [[:ascii::]] or [[:ascii]]? They seem like obvious mistakes. Obviously, nothing here should change for 5.22! -- |
The RT System itself - Status changed from 'stalled' to 'open' |
From @khwilliamsonI plan to address this and similar in 5.23 -- |
From @khwilliamsonOn 09/14/2015 01:02 PM, Karl Williamson wrote:
Several people were on the right track, but no one knew that the comment I discovered this while working on The problem is that [[:posix:]] classes have a very strict syntax, any I thought we'd agreed to add the warning to be in effect only if use re The reason the hint was somewhat misleading is that the hint itself (in There are actually three kinds of posix classes, denoted: [.posix.] The '[=' in the line [abc[=,+*;def] looks to perl like it could contain the start of a [=posix=] class, and [abc[=,+*;def] but there isn't one, so it croaks with Unmatched [ in regex; marked by <-- HERE in m/ # This is a On the other hand if there is no '=]' before the end of the pattern, it Final program: Comments should not affect the behavior of code. So at a minimum this |
From @ikegamiOn Tue, Sep 15, 2015 at 9:52 AM, Karl Williamson <public@khwilliamson.com>
You cannot place comments in a character class. Therefore, there are no The problem is that the meaning of `[=` changes based on whether `=]` is |
From perl5-porters@perl.orgKarl Williamson
The search for =] should be restricted to one line. We don't actually $ perl5.20.2 -Mre=debug -e '/[[:alpha:]]/' |
From @ikegamiOn Tue, Sep 15, 2015 at 12:19 PM, Father Chrysostomos <sprout@cpan.org>
The problem has nothing to do with newlines or /x. $ perl -e'qr/[abc[=]/' $ perl -e'qr/[abc[=] =]/' |
From @ikegamiOn Wed, Sep 16, 2015 at 12:26 PM, Eric Brine <ikegami@adaelis.com> wrote:
Better yet, the following demonstrates how concatenation two valid regex $ perl -e' |
From zefram@fysh.orgEric Brine wrote:
It's even worse than that: $ perl -e '$a=qr/[abc[=]/; $b=qr/=]/; qr/$a$b/' Fails without any explicit string concatenation. Interpolation of a -zefram |
From @AbigailOn Tue, Sep 15, 2015 at 07:52:41AM -0600, Karl Williamson wrote:
I don't, but I may have thought differently 13 years ago. I had completely
Perhaps we should not special case [= =] and [. .]. Perl doesn't support Has there every been a serious request that Perl should support the Abigail |
From @khwilliamsonOn 09/16/2015 10:40 AM, Zefram wrote:
Hmm. Actually it's not doing a string concatenation, if you look at the |
From @ap* Abigail <abigail@abigail.be> [2015-09-16 20:40]:
It makes sense when you assume that someone will port code from another The same notion must have been what led to the ~150 stubs in POSIX.pm This mindset makes sense for an ascendant language looking to establish As a point of comparison, consider the tons of “this looks like you were So it made sense for Perl 5 to do this back when it was very young. But it’s long past being in that position. So it makes sense for it to stop doing that now. Regards, |
From @jkeenanOn Wed Sep 16 11:40:33 2015, public@khwilliamson.com wrote:
khw: Do you have any thoughts as to how we might resolve this ticket? Thank you very much. -- |
From @khwilliamsonOn 1/22/2016 8:42 PM, James E Keenan via RT wrote:
I am well along on a fix to this. |
From @khwilliamsonFixed by 46d34d0 |
@khwilliamson - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for submitting this report. You have helped make Perl better. Perl 5.24.0 may be downloaded via https://metacpan.org/release/RJBS/perl-5.24.0 |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#8904 (status was 'resolved')
Searchable as RT8904$
The text was updated successfully, but these errors were encountered: