need second pair of eyes #2

Hi Alk,

What am I dong wrong here?


$ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz"; if $Line=
=20
~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |  {say "yes"}=20
else {say "no};'

=3D=3D=3DSORRY!=3D=3D=3D
Expression needs parens to avoid gobbling block
at -e:1
------> ging-/"   &&   ".tar.gz " |  {say "yes"}=E2=8F=8F else {say "no};=

Missing block (apparently claimed by expression)
at -e:1
------> ging-/"   &&   ".tar.gz " |  {say "yes"}=E2=8F=8F else {say "no};=



:'(

-T
0
ToddAndMargo
6/12/2018 10:41:21 PM
perl.perl6.users 1082 articles. 0 followers. Follow

9 Replies
48 Views

Similar Articles

[PageSpeed] 12

On 06/12/2018 03:41 PM, ToddAndMargo wrote:
> Hi Alk,
>=20
> What am I dong wrong here?
>=20
>=20
> $ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz"; if $Li=
ne=20
> ~~ | "wine-patched/archive/staging-/"=C2=A0=C2=A0 &&=C2=A0=C2=A0 ".tar.=
gz " |=C2=A0 {say "yes"}=20
> else {say "no};'
>=20
> =3D=3D=3DSORRY!=3D=3D=3D
> Expression needs parens to avoid gobbling block
> at -e:1
> ------> ging-/"=C2=A0=C2=A0 &&=C2=A0=C2=A0 ".tar.gz " |=C2=A0 {say "yes=
"}=E2=8F=8F else {say "no};
> Missing block (apparently claimed by expression)
> at -e:1
> ------> ging-/"=C2=A0=C2=A0 &&=C2=A0=C2=A0 ".tar.gz " |=C2=A0 {say "yes=
"}=E2=8F=8F else {say "no};
>=20
>=20
> :'(
>=20
> -T


This fixed it:

$ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz";if $Line =

~~ / "wine-patched\/archive\/staging\-\/" / & / ".tar.gz" /  {say "yes"} =

else {say "no"};'


How do I use "|" instead of "/"?  I am trying to rid myself of the
/\/\//\//\\/\/  tree
0
ToddAndMargo
6/12/2018 11:34:29 PM
--0000000000006f77a1056e7a5916
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Same as in perl 5:  m<delim> ... <delim>

m|xxx|


On Tue, Jun 12, 2018 at 7:35 PM ToddAndMargo <ToddAndMargo@zoho.com> wrote:

> On 06/12/2018 03:41 PM, ToddAndMargo wrote:
> > Hi Alk,
> >
> > What am I dong wrong here?
> >
> >
> > $ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz"; if $Li=
ne
> > ~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |  {say "yes"}
> > else {say "no};'
> >
> > =3D=3D=3DSORRY!=3D=3D=3D
> > Expression needs parens to avoid gobbling block
> > at -e:1
> > ------> ging-/"   &&   ".tar.gz " |  {say "yes"}=E2=8F=8F else {say "no=
};
> > Missing block (apparently claimed by expression)
> > at -e:1
> > ------> ging-/"   &&   ".tar.gz " |  {say "yes"}=E2=8F=8F else {say "no=
};
> >
> >
> > :'(
> >
> > -T
>
>
> This fixed it:
>
> $ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz";if $Line
> ~~ / "wine-patched\/archive\/staging\-\/" / & / ".tar.gz" /  {say "yes"}
> else {say "no"};'
>
>
> How do I use "|" instead of "/"?  I am trying to rid myself of the
> /\/\//\//\\/\/  tree
>


--=20
brandon s allbery kf8nh                               sine nomine associate=
s
allbery.b@gmail.com                                  ballbery@sinenomine.ne=
t
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.ne=
t

--0000000000006f77a1056e7a5916
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Same as in perl 5:=C2=A0 m&lt;delim&gt; ... &lt;delim&gt;<=
div><br></div><div>m|xxx|</div><div><br></div></div><br><div class=3D"gmail=
_quote"><div dir=3D"ltr">On Tue, Jun 12, 2018 at 7:35 PM ToddAndMargo &lt;<=
a href=3D"mailto:ToddAndMargo@zoho.com">ToddAndMargo@zoho.com</a>&gt; wrote=
:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bor=
der-left:1px #ccc solid;padding-left:1ex">On 06/12/2018 03:41 PM, ToddAndMa=
rgo wrote:<br>
&gt; Hi Alk,<br>
&gt; <br>
&gt; What am I dong wrong here?<br>
&gt; <br>
&gt; <br>
&gt; $ p6 &#39;my $Line =3D &quot;wine-patched/archive/staging-/xxxxx.tar.g=
z&quot;; if $Line <br>
&gt; ~~ | &quot;wine-patched/archive/staging-/&quot;=C2=A0=C2=A0 &amp;&amp;=
=C2=A0=C2=A0 &quot;.tar.gz &quot; |=C2=A0 {say &quot;yes&quot;} <br>
&gt; else {say &quot;no};&#39;<br>
&gt; <br>
&gt; =3D=3D=3DSORRY!=3D=3D=3D<br>
&gt; Expression needs parens to avoid gobbling block<br>
&gt; at -e:1<br>
&gt; ------&gt; ging-/&quot;=C2=A0=C2=A0 &amp;&amp;=C2=A0=C2=A0 &quot;.tar.=
gz &quot; |=C2=A0 {say &quot;yes&quot;}=E2=8F=8F else {say &quot;no};<br>
&gt; Missing block (apparently claimed by expression)<br>
&gt; at -e:1<br>
&gt; ------&gt; ging-/&quot;=C2=A0=C2=A0 &amp;&amp;=C2=A0=C2=A0 &quot;.tar.=
gz &quot; |=C2=A0 {say &quot;yes&quot;}=E2=8F=8F else {say &quot;no};<br>
&gt; <br>
&gt; <br>
&gt; :&#39;(<br>
&gt; <br>
&gt; -T<br>
<br>
<br>
This fixed it:<br>
<br>
$ p6 &#39;my $Line =3D &quot;wine-patched/archive/staging-/xxxxx.tar.gz&quo=
t;;if $Line <br>
~~ / &quot;wine-patched\/archive\/staging\-\/&quot; / &amp; / &quot;.tar.gz=
&quot; /=C2=A0 {say &quot;yes&quot;} <br>
else {say &quot;no&quot;};&#39;<br>
<br>
<br>
How do I use &quot;|&quot; instead of &quot;/&quot;?=C2=A0 I am trying to r=
id myself of the<br>
/\/\//\//\\/\/=C2=A0 tree<br>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"l=
tr"><div>brandon s allbery kf8nh =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sine nomine =
associates</div><div><a href=3D"mailto:allbery.b@gmail.com" target=3D"_blan=
k">allbery.b@gmail.com</a> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<a hr=
ef=3D"mailto:ballbery@sinenomine.net" target=3D"_blank">ballbery@sinenomine=
..net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad =C2=A0 =
=C2=A0 =C2=A0 =C2=A0<a href=3D"http://sinenomine.net" target=3D"_blank">htt=
p://sinenomine.net</a></div></div></div>

--0000000000006f77a1056e7a5916--
0
allbery
6/12/2018 11:37:17 PM
 >
 > On Tue, Jun 12, 2018 at 7:35 PM ToddAndMargo <ToddAndMargo@zoho.com
 > <mailto:ToddAndMargo@zoho.com>> wrote:
 >
 >     On 06/12/2018 03:41 PM, ToddAndMargo wrote:
 >      > Hi Alk,
 >      >
 >      > What am I dong wrong here?
 >      >
 >      >
 >      > $ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz"=
; if
 >     $Line
 >      > ~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |  {say=

 >     "yes"}
 >      > else {say "no};'
 >      >
 >      > =3D=3D=3DSORRY!=3D=3D=3D
 >      > Expression needs parens to avoid gobbling block
 >      > at -e:1
 >      > ------> ging-/"   &&   ".tar.gz " |  {say "yes"}=E2=8F=8F else =
{say "no};
 >      > Missing block (apparently claimed by expression)
 >      > at -e:1
 >      > ------> ging-/"   &&   ".tar.gz " |  {say "yes"}=E2=8F=8F else =
{say "no};
 >      >
 >      >
 >      > :'(
 >      >
 >      > -T
 >
 >
 >     This fixed it:
 >
 >     $ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz";if=
=20
$Line
 >     ~~ / "wine-patched\/archive\/staging\-\/" / & / ".tar.gz" /  {say
 >     "yes"}
 >     else {say "no"};'
 >
 >
 >     How do I use "|" instead of "/"?  I am trying to rid myself of the=

 >     /\/\//\//\\/\/  tree
 > On 06/12/2018 04:37 PM, Brandon Allbery wrote:
> Same as in perl 5:=C2=A0 m<delim> ... <delim>
>=20
> m|xxx|

so I have to include the m

Doesn't work


$ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz";if $Line =

~~ m| "wine-patched\/archive\/staging\-\/"  &  ".tar.gz" |  {say "yes"}=20
else {say "no"};'
no


:'(
0
ToddAndMargo
6/13/2018 12:14:10 AM
--0000000000003d31c7056e7aef4d
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

You're trying to do it all in one regex. That doesn't work; what you tried
will attempt to test that the same *substring* of the regex matches both of
those, which is not possible because they're both literal. So any given
substring has to be one, the other, or neither, it can't simultaneously be
both.

Either use two different matches, or put something like  .*  in between
instead of trying to use & or &&.

On Tue, Jun 12, 2018 at 8:15 PM ToddAndMargo <ToddAndMargo@zoho.com> wrote:

>  >
>  > On Tue, Jun 12, 2018 at 7:35 PM ToddAndMargo <ToddAndMargo@zoho.com
>  > <mailto:ToddAndMargo@zoho.com>> wrote:
>  >
>  >     On 06/12/2018 03:41 PM, ToddAndMargo wrote:
>  >      > Hi Alk,
>  >      >
>  >      > What am I dong wrong here?
>  >      >
>  >      >
>  >      > $ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz"=
; if
>  >     $Line
>  >      > ~~ | "wine-patched/archive/staging-/"   &&   ".tar.gz " |  {say
>  >     "yes"}
>  >      > else {say "no};'
>  >      >
>  >      > =3D=3D=3DSORRY!=3D=3D=3D
>  >      > Expression needs parens to avoid gobbling block
>  >      > at -e:1
>  >      > ------> ging-/"   &&   ".tar.gz " |  {say "yes"}=E2=8F=8F else =
{say "no};
>  >      > Missing block (apparently claimed by expression)
>  >      > at -e:1
>  >      > ------> ging-/"   &&   ".tar.gz " |  {say "yes"}=E2=8F=8F else =
{say "no};
>  >      >
>  >      >
>  >      > :'(
>  >      >
>  >      > -T
>  >
>  >
>  >     This fixed it:
>  >
>  >     $ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz";if
> $Line
>  >     ~~ / "wine-patched\/archive\/staging\-\/" / & / ".tar.gz" /  {say
>  >     "yes"}
>  >     else {say "no"};'
>  >
>  >
>  >     How do I use "|" instead of "/"?  I am trying to rid myself of the
>  >     /\/\//\//\\/\/  tree
>  > On 06/12/2018 04:37 PM, Brandon Allbery wrote:
> > Same as in perl 5:  m<delim> ... <delim>
> >
> > m|xxx|
>
> so I have to include the m
>
> Doesn't work
>
>
> $ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz";if $Line
> ~~ m| "wine-patched\/archive\/staging\-\/"  &  ".tar.gz" |  {say "yes"}
> else {say "no"};'
> no
>
>
> :'(
>


--=20
brandon s allbery kf8nh                               sine nomine associate=
s
allbery.b@gmail.com                                  ballbery@sinenomine.ne=
t
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.ne=
t

--0000000000003d31c7056e7aef4d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">You&#39;re trying to do it all in one regex. That doesn&#3=
9;t work; what you tried will attempt to test that the same *substring* of =
the regex matches both of those, which is not possible because they&#39;re =
both literal. So any given substring has to be one, the other, or neither, =
it can&#39;t simultaneously be both.<div><br></div><div>Either use two diff=
erent matches, or put something like=C2=A0 .*=C2=A0 in between instead of t=
rying to use &amp; or &amp;&amp;.</div></div><br><div class=3D"gmail_quote"=
><div dir=3D"ltr">On Tue, Jun 12, 2018 at 8:15 PM ToddAndMargo &lt;<a href=
=3D"mailto:ToddAndMargo@zoho.com">ToddAndMargo@zoho.com</a>&gt; wrote:<br><=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le=
ft:1px #ccc solid;padding-left:1ex">=C2=A0&gt;<br>
=C2=A0&gt; On Tue, Jun 12, 2018 at 7:35 PM ToddAndMargo &lt;<a href=3D"mail=
to:ToddAndMargo@zoho.com" target=3D"_blank">ToddAndMargo@zoho.com</a><br>
=C2=A0&gt; &lt;mailto:<a href=3D"mailto:ToddAndMargo@zoho.com" target=3D"_b=
lank">ToddAndMargo@zoho.com</a>&gt;&gt; wrote:<br>
=C2=A0&gt;<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0On 06/12/2018 03:41 PM, ToddAndMargo wrote:<b=
r>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Hi Alk,<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; What am I dong wrong here?<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; $ p6 &#39;my $Line =3D &quot;wine-patch=
ed/archive/staging-/xxxxx.tar.gz&quot;; if<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0$Line<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; ~~ | &quot;wine-patched/archive/staging=
-/&quot;=C2=A0 =C2=A0&amp;&amp;=C2=A0 =C2=A0&quot;.tar.gz &quot; |=C2=A0 {s=
ay<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&quot;yes&quot;}<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; else {say &quot;no};&#39;<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; =3D=3D=3DSORRY!=3D=3D=3D<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Expression needs parens to avoid gobbli=
ng block<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; at -e:1<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; ------&gt; ging-/&quot;=C2=A0 =C2=A0&am=
p;&amp;=C2=A0 =C2=A0&quot;.tar.gz &quot; |=C2=A0 {say &quot;yes&quot;}=E2=
=8F=8F else {say &quot;no};<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; Missing block (apparently claimed by ex=
pression)<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; at -e:1<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; ------&gt; ging-/&quot;=C2=A0 =C2=A0&am=
p;&amp;=C2=A0 =C2=A0&quot;.tar.gz &quot; |=C2=A0 {say &quot;yes&quot;}=E2=
=8F=8F else {say &quot;no};<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; :&#39;(<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt;<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0 &gt; -T<br>
=C2=A0&gt;<br>
=C2=A0&gt;<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0This fixed it:<br>
=C2=A0&gt;<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0$ p6 &#39;my $Line =3D &quot;wine-patched/arc=
hive/staging-/xxxxx.tar.gz&quot;;if <br>
$Line<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0~~ / &quot;wine-patched\/archive\/staging\-\/=
&quot; / &amp; / &quot;.tar.gz&quot; /=C2=A0 {say<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0&quot;yes&quot;}<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0else {say &quot;no&quot;};&#39;<br>
=C2=A0&gt;<br>
=C2=A0&gt;<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0How do I use &quot;|&quot; instead of &quot;/=
&quot;?=C2=A0 I am trying to rid myself of the<br>
=C2=A0&gt;=C2=A0 =C2=A0 =C2=A0/\/\//\//\\/\/=C2=A0 tree<br>
=C2=A0&gt; On 06/12/2018 04:37 PM, Brandon Allbery wrote:<br>
&gt; Same as in perl 5:=C2=A0 m&lt;delim&gt; ... &lt;delim&gt;<br>
&gt; <br>
&gt; m|xxx|<br>
<br>
so I have to include the m<br>
<br>
Doesn&#39;t work<br>
<br>
<br>
$ p6 &#39;my $Line =3D &quot;wine-patched/archive/staging-/xxxxx.tar.gz&quo=
t;;if $Line <br>
~~ m| &quot;wine-patched\/archive\/staging\-\/&quot;=C2=A0 &amp;=C2=A0 &quo=
t;.tar.gz&quot; |=C2=A0 {say &quot;yes&quot;} <br>
else {say &quot;no&quot;};&#39;<br>
no<br>
<br>
<br>
:&#39;(<br>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"l=
tr"><div>brandon s allbery kf8nh =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sine nomine =
associates</div><div><a href=3D"mailto:allbery.b@gmail.com" target=3D"_blan=
k">allbery.b@gmail.com</a> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<a hr=
ef=3D"mailto:ballbery@sinenomine.net" target=3D"_blank">ballbery@sinenomine=
..net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad =C2=A0 =
=C2=A0 =C2=A0 =C2=A0<a href=3D"http://sinenomine.net" target=3D"_blank">htt=
p://sinenomine.net</a></div></div></div>

--0000000000003d31c7056e7aef4d--
0
allbery
6/13/2018 12:19:11 AM
On 06/12/2018 05:19 PM, Brandon Allbery wrote:
> You're trying to do it all in one regex. That doesn't work; what you 
> tried will attempt to test that the same *substring* of the regex 
> matches both of those, which is not possible because they're both 
> literal. So any given substring has to be one, the other, or neither, it 
> can't simultaneously be both.

So I am stuck with using "/"

Thank you for the help.

-T
0
ToddAndMargo
6/13/2018 12:24:48 AM
--000000000000f79a95056e7b0aa6
Content-Type: text/plain; charset="UTF-8"

No, you are stuck with

    $foo ~~ m|xxx| && $foo ~~ m|yyy|

or

    $foo ~~ m|xxx .* yyy|

(the latter assuming they always happen in that order; if they don't, you
can only use the first.)

On Tue, Jun 12, 2018 at 8:25 PM ToddAndMargo <ToddAndMargo@zoho.com> wrote:

> On 06/12/2018 05:19 PM, Brandon Allbery wrote:
> > You're trying to do it all in one regex. That doesn't work; what you
> > tried will attempt to test that the same *substring* of the regex
> > matches both of those, which is not possible because they're both
> > literal. So any given substring has to be one, the other, or neither, it
> > can't simultaneously be both.
>
> So I am stuck with using "/"
>
> Thank you for the help.
>
> -T
>


-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

--000000000000f79a95056e7b0aa6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">No, you are stuck with<div><br></div><div>=C2=A0 =C2=A0 $f=
oo ~~ m|xxx| &amp;&amp; $foo ~~ m|yyy|</div><div><br></div><div>or</div><di=
v><br></div><div>=C2=A0 =C2=A0 $foo ~~ m|xxx .* yyy|</div><div><br></div><d=
iv>(the latter assuming they always happen in that order; if they don&#39;t=
, you can only use the first.)</div></div><br><div class=3D"gmail_quote"><d=
iv dir=3D"ltr">On Tue, Jun 12, 2018 at 8:25 PM ToddAndMargo &lt;<a href=3D"=
mailto:ToddAndMargo@zoho.com">ToddAndMargo@zoho.com</a>&gt; wrote:<br></div=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex">On 06/12/2018 05:19 PM, Brandon Allbery wro=
te:<br>
&gt; You&#39;re trying to do it all in one regex. That doesn&#39;t work; wh=
at you <br>
&gt; tried will attempt to test that the same *substring* of the regex <br>
&gt; matches both of those, which is not possible because they&#39;re both =
<br>
&gt; literal. So any given substring has to be one, the other, or neither, =
it <br>
&gt; can&#39;t simultaneously be both.<br>
<br>
So I am stuck with using &quot;/&quot;<br>
<br>
Thank you for the help.<br>
<br>
-T<br>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"l=
tr"><div>brandon s allbery kf8nh =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 sine nomine =
associates</div><div><a href=3D"mailto:allbery.b@gmail.com" target=3D"_blan=
k">allbery.b@gmail.com</a> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<a hr=
ef=3D"mailto:ballbery@sinenomine.net" target=3D"_blank">ballbery@sinenomine=
..net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad =C2=A0 =
=C2=A0 =C2=A0 =C2=A0<a href=3D"http://sinenomine.net" target=3D"_blank">htt=
p://sinenomine.net</a></div></div></div>

--000000000000f79a95056e7b0aa6--
0
allbery
6/13/2018 12:26:56 AM
My recommendations:

=C2=A0=C2=A0=C2=A0 if $line.contains(all("wine-patched/archive/staging-/"=
, ".tar.gz")){ }

=C2=A0=C2=A0=C2=A0 # if the path has to be at the beginning and the exten=
sion at the end,
=C2=A0=C2=A0=C2=A0 # which your original regex doesn't require, but it's =
probably right
=C2=A0=C2=A0=C2=A0 if $line.starts-with("wine-patched/archive/staging-/")=
 &&
$line.ends-with(".tar.gz") { }

=C2=A0=C2=A0=C2=A0 if $line ~~ m{ "wine-patched/archive/staging-/" .* ".t=
ar.gz" } { }

What do you think?
=C2=A0 - Timo
0
timo
6/13/2018 12:47:32 AM
On 06/12/2018 05:26 PM, Brandon Allbery wrote:
> No, you are stuck with
>=20
>  =C2=A0 =C2=A0 $foo ~~ m|xxx| && $foo ~~ m|yyy|
>=20
> or
>=20
>  =C2=A0 =C2=A0 $foo ~~ m|xxx .* yyy|


Ah cool.  And it insures that they are "in a row"
now anywhere in the string, as with the double "if"

$ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz";if $Line =

~~ m| "wine-patched/archive/staging-/" .*? ".tar.gz" |  {say "yes"} else =

{say "no"};'

yes

Thank you!
0
ToddAndMargo
6/13/2018 1:06:06 AM
On 06/12/2018 05:47 PM, Timo Paulssen wrote:
> My recommendations:
>=20
>  =C2=A0=C2=A0=C2=A0 if $line.contains(all("wine-patched/archive/staging=
-/", ".tar.gz")){ }
>=20
>  =C2=A0=C2=A0=C2=A0 # if the path has to be at the beginning and the ex=
tension at the end,
>  =C2=A0=C2=A0=C2=A0 # which your original regex doesn't require, but it=
's probably right
>  =C2=A0=C2=A0=C2=A0 if $line.starts-with("wine-patched/archive/staging-=
/") &&
> $line.ends-with(".tar.gz") { }
>=20
>  =C2=A0=C2=A0=C2=A0 if $line ~~ m{ "wine-patched/archive/staging-/" .* =
".tar.gz" } { }
>=20
> What do you think?
>  =C2=A0 - Timo
>=20

I like it.

I used

$ p6 'my $Line =3D "wine-patched/archive/staging-/xxxxx.tar.gz";if $Line =

~~ m| "wine-patched/archive/staging-/" .*? ".tar.gz" |  {say "yes"} else =

{say "no"};'
yes

as it insures the patterns are in sequence, not random.

Thank you!
0
ToddAndMargo
6/13/2018 1:09:39 AM
Reply: