Re: What is the official name of regex switches?

2018-09-15 Thread ToddAndMargo
On 09/15/2018 07:24 PM, Larry Wall wrote: On Sat, Sep 15, 2018 at 06:37:34PM -0700, ToddAndMargo wrote: : Hi All, : : \L : \N I don't really know what you mean by those. Regex switches are things like :i for case insensitivity. They're also called regex modifiers or regex options. They

Re: Need regex help

2018-09-15 Thread Larry Wall
On Sat, Sep 15, 2018 at 06:45:33PM -0700, ToddAndMargo wrote: : Hi All, : : I have been doing a bunch with regex's lately. : I just throw them out based on prior experience : and they most all work now. I only sometimes have to : ask for help. (The look forward () feature : is sweet.) : :

Re: What is the official name of regex switches?

2018-09-15 Thread Larry Wall
On Sat, Sep 15, 2018 at 06:37:34PM -0700, ToddAndMargo wrote: : Hi All, : : \L : \N I don't really know what you mean by those. Regex switches are things like :i for case insensitivity. They're also called regex modifiers or regex options. They always start with colon. Something with a

Need regex help

2018-09-15 Thread ToddAndMargo
Hi All, I have been doing a bunch with regex's lately. I just throw them out based on prior experience and they most all work now. I only sometimes have to ask for help. (The look forward () feature is sweet.) Anyway, I have been using regex switches without knowing why. So What is the

What is the official name of regex switches?

2018-09-15 Thread ToddAndMargo
Hi All, \L \N Since I use them all the time and there is a big long list of them over on https://docs.perl6.org/language/regexes#index-entry-regex_%3C%3Aproperty%3E-Unicode_properties it is about time I know their "Official" name? I presume "regex switches" is not their official name. -T

Re: Need help with a variable inside a regex

2018-09-15 Thread ToddAndMargo
On Sat, Sep 15, 2018 at 4:09 AM ToddAndMargo > wrote: On 09/15/2018 12:42 AM, ToddAndMargo wrote: > Hi All, > > I am truing to use a variable inside a regex. > > This work (without the variable): >     $ p6 'my

Re: .kv ?

2018-09-15 Thread Brad Gilbert
On Fri, Sep 14, 2018 at 10:37 PM ToddAndMargo wrote: > > On 09/14/2018 08:09 PM, Brad Gilbert wrote: > > I think that it is because of how you read. > > > > The way your brain figures out what is written, is slow. > > That is how the human the human brain works. It is > always looking for

Re: need p5/p6 :: help

2018-09-15 Thread Brent Laabs
Now that Larry has spoken on the issue of vocabulary, it's lexicanonical. On Fri, Sep 14, 2018 at 12:49 PM Larry Wall wrote: > On Fri, Sep 14, 2018 at 04:15:02AM -0700, Todd Chester wrote: > : Also, did you answer my question about "::" and did it > : just go over my head? > > The implication

Re: Multibyte string in Windows command line

2018-09-15 Thread Brad Gilbert
I was just informed by samcv on #perl6-dev that she got the utf16 stream decoder implemented. http://colabti.org/irclogger/irclogger_log/perl6-dev?date=2018-09-15#l381 It should be in the next release, so after that there won't be a reason to do the dance I described earlier. The following

Re: need p5/p6 :: help

2018-09-15 Thread Larry Wall
On Fri, Sep 14, 2018 at 06:12:15PM -0400, Vadim Belman wrote: : Though technically this aspect was clear to me, but to settle things down in my mind completely: for now ordinary (not 'our') sub belongs not to the package object but to the block which belongs to that package. Is it correct way to

Re: Need help with a variable inside a regex

2018-09-15 Thread Brandon Allbery
To interpolate a variable as a regex instead of as a string literal, you need to wrap it in < >. On Sat, Sep 15, 2018 at 4:09 AM ToddAndMargo wrote: > On 09/15/2018 12:42 AM, ToddAndMargo wrote: > > Hi All, > > > > I am truing to use a variable inside a regex. > > > > This work (without the

Re: Need help with a variable inside a regex

2018-09-15 Thread ToddAndMargo
On 09/15/2018 12:42 AM, ToddAndMargo wrote: Hi All, I am truing to use a variable inside a regex. This work (without the variable):    $ p6 'my $x="6937-2.2.19882.exe"; if $x ~~ m/ .*? <<:\N**4>>  "-" (.*?) ".exe" / {say "yes";}'    yes I want to turn `<<:\N**4>>` into a variable:    $

Need help with a variable inside a regex

2018-09-15 Thread ToddAndMargo
Hi All, I am truing to use a variable inside a regex. This work (without the variable): $ p6 'my $x="6937-2.2.19882.exe"; if $x ~~ m/ .*? <<:\N**4>> "-" (.*?) ".exe" / {say "yes";}' yes I want to turn `<<:\N**4>>` into a variable: $ p6 'my $x="6937-2.2.19882.exe"; my

Re: I need hash syntax help

2018-09-15 Thread ToddAndMargo
On Fri, Sep 14, 2018 at 11:59 PM ToddAndMargo > wrote: Hi All, Why does `$y =%x<<$z>>` work in the following and `$y =%x<$z>` and `$y =%x<"$z"> do not work? $ p6 'my Str %x=("Jan"=>"01", "Feb"=>"02"); my Str $z="Jan"; my $y

Re: I need hash syntax help

2018-09-15 Thread Brent Laabs
Because << >> is a double-quoted index (same as quote words «»), so it interpolates the variable. <> is a single-quoted string, so it doesn't interpolate. But what you really want here is %x{$z}, so you don't bother with string interpolation at all, and pass the String variable directly. On

I need hash syntax help

2018-09-15 Thread ToddAndMargo
Hi All, Why does `$y =%x<<$z>>` work in the following and `$y =%x<$z>` and `$y =%x<"$z"> do not work? $ p6 'my Str %x=("Jan"=>"01", "Feb"=>"02"); my Str $z="Jan"; my $y =%x<<$z>>; say "$y";' 01 Why did I get it right? Many thanks, -T