Skip to content
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

^, ^^, $, $$ in the middle of regexes #4330

Closed
p6rt opened this issue Jun 17, 2015 · 4 comments
Closed

^, ^^, $, $$ in the middle of regexes #4330

p6rt opened this issue Jun 17, 2015 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Jun 17, 2015

Migrated from rt.perl.org#125431 (status was 'rejected')

Searchable as RT125431$

@p6rt
Copy link
Author

p6rt commented Jun 17, 2015

From @AlexDaniel

Code​:
say 'test' ~~ / te $$ st /;

Result​:
Nil

Well, sure it is Nil, but the problem is that there is no string that could
possible match that regex (not even 'te$$st'). If such regex does not make
any sense, then an error should be thrown.

@p6rt
Copy link
Author

p6rt commented Jun 19, 2015

From @jnthn

On Wed Jun 17 14​:42​:31 2015, alex.jakimenko@​gmail.com wrote​:

Code​:
say 'test' ~~ / te $$ st /;

Result​:
Nil

Well, sure it is Nil, but the problem is that there is no string that could
possible match that regex (not even 'te$$st'). If such regex does not make
any sense, then an error should be thrown.

^^ and $$ could easily match in the middle of a string, since they mean "start of line" and "end of line", and strings can be multi-line. While ^ and $ never could match in the middle of a regex, I don't think it's worth the compiler bloat to catch that one.

@p6rt
Copy link
Author

p6rt commented Jun 19, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt closed this as completed Jun 19, 2015
@p6rt
Copy link
Author

p6rt commented Jun 19, 2015

@jnthn - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant