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
bug in perl 5.005_61 #699
Comments
From swiftkid@bigfoot.comCreated by swiftkid@bigfoot.comUnder Perl 5.005_61, this line produces an error: Unmatched regexp [] ... So I reinstalled Perl 5.005_3, and it works fine with it! Something is wrong in the regexp lib. Perl Info
|
From @RandalSchwartz
Faisal> Under Perl 5.005_61, this line produces an error: Faisal> Not that your bug report isn't perhaps valid, you should also know I won't quote the FAQ here. Please read it. -- |
From [Unknown Contact. See original ticket]
The '-' inside [...] is considered as a range. Try '\-' instead. Good luck, |
From [Unknown Contact. See original ticket]Konovalov, Vadim writes:
After \w?! It should not. I wonder whether this is POSIX-classes Ilya |
From @jhiIlya Zakharevich writes:
In 62-to-be I get /^[\w-.]+\@[\w-]+\.[\w-.]+$/: invalid [] range in regexp at -e line 1. which is what I would have expected. A range like \w-. makes no sense. /^[\w.]+\@\w+\.[\w.]+$/ I plead guilty of putting in a stricter check for bogus ranges. [ 3926] By: jhi on 1999/08/05 17:25:19 If anybody can explain to me what [\w-.] would mean, I will rethink. -- |
From @jhiOops, I take my bitching about a range ending into "nothing" back: perlre of both 5.005_04 and 5.005_03: If you want "-" itself to be a member of a class, put it But the other issue remains: Note that \w matches a single alphanumeric character, not a whole word. To -- |
From [Unknown Contact. See original ticket]On Tue, Oct 12, 1999 at 11:12:54AM +0300, Jarkko Hietaniemi wrote:
This is still ambiguous: \w-. may be either \w\-., or a syntax error. Ilya |
From @jhi
Hmmm. On the other hand, it seems that constructs like [\w-.] have Either we take out my patch and fix the documentation to comply, -- |
From [Unknown Contact. See original ticket]: > > match a word you'd need to say \w+. You may use \w, \W, \s, \S, \d That is what I said in my initial message.... it worked in Perl 5.005_3. I vote it to be automatically escaped.... so \w-. whould still be possible. I wonder if my vote matters! :-) |
From @jhiFaisal Nasim writes:
But you still didn't read the documentation :-) -- |
From [Unknown Contact. See original ticket]Ilya Zakharevich <ilya@math.ohio-state.edu> wrote
Since it currently works, this is a bug in the documentation. :-) The documentation should be fixed rather than breaking currently But if we were designing this from scratch, I'd vote for an error. Hmm.. After writing the above, I actually tried some experiments. [\w-.] works (i.e. treats - as escaped) So I also recommend fixing [.-\w] , for consistency. Mike Guy |
From @jhiM.J.T. Guy writes:
It seems that at least my patch consistently made all the above illegal. -- |
From @tamiasOn Tue, Oct 12, 1999 at 02:49:38PM +0100, M.J.T. Guy wrote:
I strongly disagree. Since this is documented not to work, it is an error This is a clear case of programs taking advantage of an obscure bug in Ronald |
From @jhiRonald J Kimball writes:
I can fix it both ways, let me know when the hydra called p5p has -- |
From @jhiJarkko Hietaniemi writes:
Errr, "either way", methinks... -- |
From @jhiRonald J Kimball writes:
As I just happened to finish testing the patch to return to the -- |
From [Unknown Contact. See original ticket]: I strongly disagree. Since this is documented not to work, it is an error And can't you consider it as a feature? if "." is followed by a multiple pattern match regexp, its considered How can I contribute to Perl? (is there any age requirement? :P) |
From @TimToadyjhi@iki.fi writes: Nobody's mentioned the option of issuing a warning. I think I'd prefer Larry |
From @tamiasOn Tue, Oct 12, 1999 at 09:39:27PM +0500, Faisal Nasim wrote:
If you want the character class [\w\-.], I think it's just as easy to write The documentation makes it clear that, just like in regex syntaxes of most Ronald |
From [Unknown Contact. See original ticket]: Nobody's mentioned the option of issuing a warning. I think I'd prefer How about issuing a warning? :-) Why are there qq/q/qx? When you could simply: print "blah is \"cool\" and foobar is \"not\"cool"; ? |
From [Unknown Contact. See original ticket]: Why are there qq/q/qx? When you could simply: and don't forget qw. |
From [Unknown Contact. See original ticket]Larry Wall <larry@wall.org> writes:
But it is "obvious" that \w-\d is a "range" of alphabetics and '_' ;-) -- |
From [Unknown Contact. See original ticket]At 06:05 PM 10/12/99 +0100, Nick Ing-Simmons wrote:
Hey, yeah! Set operations in character classes! Unicode has the set Dan ----------------------------------------"it's like this"------------------- |
From @jhiDan Sugalski writes:
Yes, it has. <...> Ummm, it seems the "+" is kind of taken... :-) -- |
From @jhiLarry Wall writes:
Aargh, a third option! :-) But an option I find awfully tempting... -- |
From [Unknown Contact. See original ticket]At 09:07 PM 10/12/99 +0300, Jarkko Hietaniemi wrote:
I was thinking of the horseshoes (or whatever they're called. Union and Dan ----------------------------------------"it's like this"------------------- |
From @jhiNow 62-to-be is rigged to accept dashes as literals in "false ranges" /akjhfd[xa-\dz]/: false [] range "a-\d" in regexp at -e line 1. The perldiag entry says: (W) A character class range must start and end at a literal character, not -- |
From @jhiWhile staring at regclass() I noticed a possible additional source On the other hand, in 5.005_5X Ilya's patch that complains about Should I add a similar warning for character classes, -- |
From [Unknown Contact. See original ticket]On Fri, Oct 15, 1999 at 12:33:40AM +0300, Jarkko Hietaniemi wrote:
Thanks, yes. I missed this case... Ilya |
From @jhi
Done. Now e.g. [a\zb] (with -w) triggers such a warning. -- |
Migrated from rt.perl.org#1601 (status was 'resolved')
Searchable as RT1601$
The text was updated successfully, but these errors were encountered: