On Mon, Mar 22, 2021 at 2:50 PM yary wrote:
>
> how to get all nested captures worked for me ... not sure I agree with the
> design
I think the current flattening aspect is awkward in a couple ways:
* Having to specify ``. I half like Brad's suggestion.
* Having to write `.pairs` to extract th
Hi all,
Thanks Bill for posting your results from my samples. Seems like we both
get lots of warnings/errors from our REPL's, me even with 2021.02.01. I
suspect there must be something going on with what the REPL is trying to
print, after all it does want to display the results of every line. I
ha
Hi Yary,
I ran your Raku code in a script (on MacOS) and in the REPL (MacOS with
Linenoise). All results below with Rakudo_2020.10:
#Script:
my $word = /(\w+)/;
my $AwithB = /$word' with '$word/;
$_= 'Interpolating regexes with arbitrary captures is fun!';
say "Nested rx";
dd m/$AwithB.*'is '$wo
On Wed, Mar 17, 2021 at 7:17 PM William Michels via perl6-users
wrote:
>
> ("If the first character inside is anything other than an alpha it doesn't
> capture").
> It should be added to the Raku Docs ASAP.
Fyi, here's how Larry Wall expressed it 15-18 years ago:
> A leading alphabetic characte
On Fri, Mar 19, 2021 at 6:12 PM yary wrote:
>
> I don't know how to get the result.
> DB<1> $word = qr/(\w+)/;
> DB<2> $AwithB = qr/$word with $word/
> DB<3> $_ = 'Interpolating regexes with arbitrary captures is fun!'
> DB<4> x /$AwithB.*is $word/
A Raku equivalent:
my $word = '(\w+)';
my $Awi
My current expectations are a little different than any others previously
expressed and I don't know how to get the result. I am no longer
considering named captures from Regex's interpolated inside and am now looking at directly interpolating them.
Perl example:
DB<1> *$word = qr/(\w+)/;*
DB<
On Thu, Mar 18, 2021 at 12:59 AM yary wrote:
>
> As it is I get same kinds of errors in the REPL, perhaps it is MacOS
> with Linenoise that's mucking that up.
I can confirm your new test code also works fine in both program
and repl forms in 2020.12.
Though obviously the case you mark as "intere
Thanks raiph for everything!
Including getting me to upgrade my Raku, "Welcome to Rakudo(tm) v2021.02.1.
Implementing the Raku(tm) programming language v6.d.
Built on MoarVM version 2021.02."
As it is I get same kinds of errors in the REPL, perhaps it is MacOS with
Linenoise that's mucking tha
> 1. The list you posted is fantastic ("If the first character inside is
> anything other
> than an alpha it doesn't capture"). It should be added to the Raku Docs ASAP.
Not the list, right? Just the rule. (There are dozens of kinds of
assertions. No one
is going to remember the list.) If you wer
And when I cut/paste from the doc, the number example works too,
in both script and repl.
On Wed, Mar 17, 2021 at 10:33 PM Ralph Mellor wrote:
>
> Er, by wfm I mean it matches 「Is」 as the code suggests.
>
> On Wed, Mar 17, 2021 at 10:32 PM Ralph Mellor wrote:
> >
> > Works for me in Rakudo 2020.
Er, by wfm I mean it matches 「Is」 as the code suggests.
On Wed, Mar 17, 2021 at 10:32 PM Ralph Mellor wrote:
>
> Works for me in Rakudo 2020.12.
>
> On Wed, Mar 17, 2021 at 9:33 PM yary wrote:
> >
> > The "Interpolation" section of the raku docs use strings as the elements of
> > building up a
Works for me in Rakudo 2020.12.
On Wed, Mar 17, 2021 at 9:33 PM yary wrote:
>
> The "Interpolation" section of the raku docs use strings as the elements of
> building up a larger regex from smaller pieces, but the example that looks
> fruitful isn't working in my raku. This is taken from
> htt
The "Interpolation" section of the raku docs use strings as the elements of
building up a larger regex from smaller pieces, but the example that looks
fruitful isn't working in my raku. This is taken from
https://docs.raku.org/language/regexes#Regex_interpolation
> my $string = 'Is this a regex
Dear Brad,
1. The list you posted is fantastic ("If the first character inside is
anything other than an alpha it doesn't capture"). It should be added to
the Raku Docs ASAP.
2. There are some shortcuts that don't seem to follow a set pattern. For
example a named capture can be accessed using $ i
And once again, thanks much for the explication of all this...
But even after thinking it over, the current state-of-affairs on
this really doesn't strike me as being okay.
As I'm sure everyone here knows, over in perl-land the main trick
you have for creating regexes from components is lexical
in
It makes <…> more consistent precisely because <$pattern> doesn't capture.
If the first character inside is anything other than an alpha it doesn't
capture.
Which is a very simple description of when it captures.
doesn't capture because of the 「?」
doesn't capture because of the 「!」
Thanks much for your answer on this. I think this is the sort of
trick I was looking for:
Brad Gilbert wrote:
> You can put it back in as a named
> > $input ~~ /
> 「9 million」
> pattern => 「9 million」
> 0 => 「9」
> 1 => 「million」
That's good enough, I guess, though you
If you interpolate a regex, it is a sub regex.
If you have something like a sigil, then the match data structure gets
thrown away.
You can put it back in as a named
> $input ~~ /
「9 million」
pattern => 「9 million」
0 => 「9」
1 => 「million」
Or as a numbered:
> $input
18 matches
Mail list logo