need <-[x]> help

2018-05-03 Thread Todd Chester
Hi All, What I am trying to do is to replace a quote `"` with `inches`, but NOT when the quote is followed by a comma `,`. In other words, ignore `",` I am not having too good a time with it. What am I doing wrong? $ perl6 -e 'my $x=qw["44","7" ab","","999"]; say "$x";$x~~s:g/\"(.)<-[,]>/ in

Re: need <-[x]> help

2018-05-03 Thread jerry gay
you want a negative lookahead assertion, which are described (with an example) at https://docs.perl6.org/language/regexes#Lookahead_Assertions On Thu, May 3, 2018 at 3:10 AM, Todd Chester wrote: > Hi All, > > What I am trying to do is to replace a quote `"` > with `inches`, but NOT when the quot

Re: need <-[x]> help

2018-05-03 Thread Fernando Santagata
Hi Todd, I tried to match a single string to begin with: my $x = '"7" ab"'; $x ~~ s:g/ (.) \" /inches($0)/; say $x; # "inches(7) ab" On Thu, May 3, 2018 at 12:11 PM Todd Chester wrote: > Hi All, > > What I am trying to do is to replace a quote `"` > with `inches`, but NOT when the quote is f

OT: creating an icon on the task bar

2018-05-03 Thread Todd Chester
Hi All, But only a little bit off topic. Windows 7 Pro, SP1, 32 bit I created a Perl6 program for a customer. I created a shortcut to it on the desktop. But Windows won't allow me to to copy it to the task bar as perl6 is a batch file. Looking at google, the trick of creating cmd /

Re: OT: creating an icon on the task bar

2018-05-03 Thread yary
Windows? Try making a shortcut to the .pl6 file, then you can change the icon of the shortcut, and put that in the task bar. I don't remember the details but it ought to be enough to find it via web search. -y On Thu, May 3, 2018 at 8:55 PM, Todd Chester wrote: > Hi All, > > But only a little b

Re: need <-[x]> help

2018-05-03 Thread JJ Merelo
Once again, can anyone post this to StackOverflow? El jue., 3 may. 2018 a las 16:50, Fernando Santagata (< nando.santag...@gmail.com>) escribió: > Hi Todd, > > I tried to match a single string to begin with: > > my $x = '"7" ab"'; > $x ~~ s:g/ (.) \" /inches($0)/; > say $x; > > # "inches(7) ab"

Is negative lookbehind behaving here?

2018-05-03 Thread yary
I want to match something anywhere but at the end of a string in one example, or anywhere but at the start of a string in another example. The "except at start" one has me stumped. Not sure if it's me or if I've tickled a bug. perl6 --version This is Rakudo Star version 2018.01 built on MoarVM ver

Re: A s/// brain teaser to share

2018-05-03 Thread yary
What you really want is to change a quote to "inch" if the quote is not at the start of the line, not preceeded by a comma, not followed by a comma, and not at the end of a line. > $LabelStr ~~ s:global|"3/4\""|3/4 inch|; But that will only fix inch when it is after 3/4 how about > $_='"6" hand"