We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Migrated from rt.perl.org#64188 (status was 'rejected')
Searchable as RT64188$
The text was updated successfully, but these errors were encountered:
<masak> rakudo: +("freeeeeeeeeeeeeeeew" ~~ /('e'|'w')*/)[0] <p6eval> rakudo 9a84c3: OUTPUT«Use of uninitialized value» <masak> <TimToady> that oughta work... <masak> did someone report this? <masak> rakudo: +("eeeeeeeeeeeeeeeew" ~~ /('e'|'w')*/)[0] <p6eval> rakudo 9a84c3: RESULT«17» * masak submits rakudobug
The first piece of code should evaluate to 17 as well, IMO. The regex was later simplified to /(e)*/ with the same outcome.
Sorry, something went wrong.
On Wed Mar 25 02:57:13 2009, masak wrote:
<masak> rakudo: +("freeeeeeeeeeeeeeeew" ~~ /('e'|'w')*/)[0] <p6eval> rakudo 9a84c3: OUTPUT«Use of uninitialized value» <masak> <TimToady> that oughta work... <masak> did someone report this? <masak> rakudo: +("eeeeeeeeeeeeeeeew" ~~ /('e'|'w')*/)[0] <p6eval> rakudo 9a84c3: RESULT«17» * masak submits rakudobug The first piece of code should evaluate to 17 as well, IMO. The regex was later simplified to /(e)*/ with the same outcome.
It does work as designed. It matches the zero repetition (and thus empty string)
15:53 < moritz_> rakudo: ?("freeeeeeeeeeeeeeeew" ~~ /('e'|'w')*/) 15:53 < p6eval> rakudo 9a84c3: RESULT«Bool::True»
And since it matched the parenthesis group zero times, $/[0] is the empty list.
If you want to match at least once, use +.
Cheers, Moritz
The RT System itself - Status changed from 'new' to 'open'
@moritz - Status changed from 'open' to 'rejected'
No branches or pull requests
Migrated from rt.perl.org#64188 (status was 'rejected')
Searchable as RT64188$
The text was updated successfully, but these errors were encountered: