Navigation Menu

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

:p modifier doesn't anchor to $/.to by default #3334

Open
p6rt opened this issue Feb 17, 2014 · 1 comment
Open

:p modifier doesn't anchor to $/.to by default #3334

p6rt opened this issue Feb 17, 2014 · 1 comment
Labels
regex Regular expressions, pattern matching, user-defined grammars, tokens and rules

Comments

@p6rt
Copy link

p6rt commented Feb 17, 2014

Migrated from rt.perl.org#121263 (status was 'new')

Searchable as RT121263$

@p6rt
Copy link
Author

p6rt commented Feb 17, 2014

From @ShimmerFairy

<lue> r​: my $a = "LOHELLO"; say $a ~~ /EL/; $a .= subst(/LO/, "HI", :p); say $a
<camelia> rakudo-parrot 230a54, rakudo-jvm 230a54, rakudo-moar 230a54​: OUTPUT«「EL」␤␤LOHELLO␤»
<lue> r​: my $a = "LOHELLO"; say $a ~~ /EL/; $a .= subst(/LO/, "HI", :p($/.to)); say $a
<camelia> rakudo-parrot 230a54, rakudo-jvm 230a54, rakudo-moar 230a54​: OUTPUT«「EL」␤␤LOHELHI␤»
* lue files rakudobug

By default, :p is defined to be ($/ ?? $/.to !! 0) , however this does not appear to be the case.

@p6rt p6rt added the regex Regular expressions, pattern matching, user-defined grammars, tokens and rules label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regex Regular expressions, pattern matching, user-defined grammars, tokens and rules
Projects
None yet
Development

No branches or pull requests

1 participant