How do I remove leading zeros?

Hi All,

I am trying to turn

     01.02.03

into

     1.2.3

What am I doing wrong, this time?

$ p6 'my $x="01.02.03"; $x ~~ s:global/"0"(\d)/ $0 /; say "$x"'
  1 . 2 . 3


Many thanks,
-T


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When we ask for advice, we are usually looking for an accomplice.
    --  Charles Varlet de La Grange
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
ToddAndMargo
6/13/2018 4:56:54 AM
perl.perl6.users 1074 articles. 0 followers. Follow

13 Replies
51 Views

Similar Articles

[PageSpeed] 23

--00000000000063e1df056e7f2b8b
Content-Type: text/plain; charset="UTF-8"

On Wed, 13 Jun 2018 at 14:57, ToddAndMargo <ToddAndMargo@zoho.com> wrote:

> I am trying to turn
>
>      01.02.03
>
> into
>
>      1.2.3
>
> What am I doing wrong, this time?
>
> $ p6 'my $x="01.02.03"; $x ~~ s:global/"0"(\d)/ $0 /; say "$x"'
>   1 . 2 . 3
>
>
The second part of the s/// operator is a string (spaces count), not a
regex (spaces ignored).

> my $x="01.02.03"; $x ~~ s:global/"0"(\d)/$0/; say "$x"
1.2.3

-- 
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia

ngaywood@une.edu.au  http://turing.une.edu.au/~ngaywood
Phone: +61 (0)2 6773 2412  Mobile: +61 (0)4 7862 0062

Please avoid sending me Word or Power Point attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

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

<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, 13 Jun=
 2018 at 14:57, ToddAndMargo &lt;<a href=3D"mailto:ToddAndMargo@zoho.com">T=
oddAndMargo@zoho.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex">I am trying to turn<br>
<br>
=C2=A0 =C2=A0 =C2=A001.02.03<br>
<br>
into<br>
<br>
=C2=A0 =C2=A0 =C2=A01.2.3<br>
<br>
What am I doing wrong, this time?<br>
<br>
$ p6 &#39;my $x=3D&quot;01.02.03&quot;; $x ~~ s:global/&quot;0&quot;(\d)/ $=
0 /; say &quot;$x&quot;&#39;<br>
=C2=A0 1 . 2 . 3<br><br></blockquote><div><br></div><div>The second part of=
 the s/// operator is a string (spaces count), not a regex (spaces ignored)=
..</div><div><div><br></div><div>&gt; my $x=3D&quot;01.02.03&quot;; $x ~~ s:=
global/&quot;0&quot;(\d)/$0/; say &quot;$x&quot;</div><div>1.2.3</div></div=
><div>=C2=A0<br></div></div>-- <br><div dir=3D"ltr" class=3D"gmail_signatur=
e"><div dir=3D"ltr"><div>Norman Gaywood, Computer Systems Officer</div><div=
>School of Science and Technology<br>University of New England</div><div>Ar=
midale=C2=A0NSW 2351, Australia<br><br><a href=3D"mailto:ngaywood@une.edu.a=
u" target=3D"_blank">ngaywood@une.edu.au</a>=C2=A0=C2=A0<a href=3D"http://t=
uring.une.edu.au/~ngaywood" target=3D"_blank">http://turing.une.edu.au/~nga=
ywood</a></div><div>Phone: +61 (0)2 6773 2412 =C2=A0Mobile: +61 (0)4 7862 0=
062<br><br>Please avoid sending me Word or Power Point attachments.<br>See =
<a href=3D"http://www.gnu.org/philosophy/no-word-attachments.html" target=
=3D"_blank">http://www.gnu.org/philosophy/no-word-attachments.html</a><br><=
/div></div></div></div>

--00000000000063e1df056e7f2b8b--
0
ngaywood
6/13/2018 5:22:20 AM
On 06/12/2018 09:56 PM, ToddAndMargo wrote:
> Hi All,
>=20
> I am trying to turn
>=20
>  =C2=A0=C2=A0=C2=A0 01.02.03
>=20
> into
>=20
>  =C2=A0=C2=A0=C2=A0 1.2.3
>=20
> What am I doing wrong, this time?
>=20
> $ p6 'my $x=3D"01.02.03"; $x ~~ s:global/"0"(\d)/ $0 /; say "$x"'
>  =C2=A01 . 2 . 3
>=20
>=20
> Many thanks,
> -T
>=20
>=20


Got it:

$ p6 'my $x =3D "01.0.3.06.10"; say ($x.comb(/\d+/)>>.Int).join(".");'
1.0.3.6.10



--=20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
ToddAndMargo
6/13/2018 5:38:23 AM
If $x is set to "01.02.03"

(Not using normal message quoting to make message shorter.
[1] ToddAndMargo    [2] Norman Gaywood    [3] Mark Senn)

DOING         $x ~~ s:global/"0"(\d)/ $0 /;                              [1]
SETS $x TO    "1 . 2 . 3"                                                [1]
COMMENT       Spaces on right hand side of s command are significant.    [2]

DOING         $x ~~ s:global/"0"(\d)/$0/;                                [2]
SETS $x to    "1.2.3"                                                    [2]
COMMENT       Zeroes would de deleted from "101.102.103".                [3]

(I suspect the general case is delete leading zeroes or zeroes
immediately following periods.)

DOING         $x ~~ s:g/(^|".")0+/$0/;                                   [3]
              or, using named captures,
              $x ~~ s:g/$<leader>=(^|".")0+/$<leader>/;
SETS $x to    "1.2.3"                                                    [3]
COMMENT       Zeroes would not be deleted from "101.102.103".            [3]

For me, the last solution is the clearest: replace all beginning of
strings or "."  followed by one or more zeroes by the beginning of the
string or ".", whichever was matched.

-mark
0
mark
6/13/2018 2:02:43 PM
I'd probably just write something like:

    s:g { � <( 0+ )> \d+ � } = '';

The first <( and the last � are not strictly necessary, but add clarity, or
at least balance.  But in golf mode you could get away with something like:

    sg/�0+)>\d//;

Larry
0
larry
6/13/2018 6:00:18 PM
On 06/12/2018 10:22 PM, Norman Gaywood wrote:
> On Wed, 13 Jun 2018 at 14:57, ToddAndMargo <ToddAndMargo@zoho.com=20
> <mailto:ToddAndMargo@zoho.com>> wrote:
>=20
>     I am trying to turn
>=20
>      =C2=A0 =C2=A0 =C2=A001.02.03
>=20
>     into
>=20
>      =C2=A0 =C2=A0 =C2=A01.2.3
>=20
>     What am I doing wrong, this time?
>=20
>     $ p6 'my $x=3D"01.02.03"; $x ~~ s:global/"0"(\d)/ $0 /; say "$x"'
>      =C2=A0 1 . 2 . 3
>=20
>=20
> The second part of the s/// operator is a string (spaces count), not a =

> regex (spaces ignored).
>=20
>  > my $x=3D"01.02.03"; $x ~~ s:global/"0"(\d)/$0/; say "$x"
> 1.2.3


Thank you!

$ p6 'my $x =3D "01.0.3.06.10"; $x ~~ s:global/"0"(\d)/$0/; say "$x"'
1.0.3.6.10
0
ToddAndMargo
6/13/2018 6:00:54 PM
On 06/13/2018 11:00 AM, Larry Wall wrote:
> I'd probably just write something like:
>=20
>      s:g { =C2=AB <( 0+ )> \d+ =C2=BB } =3D '';
>=20
> The first <( and the last =C2=BB are not strictly necessary, but add cl=
arity, or
> at least balance.  But in golf mode you could get away with something l=
ike:
>=20
>      sg/=C2=AB0+)>\d//;
>=20
> Larry
>=20


Awesome!  Thank you!

$ p6 'my $x =3D "01.0.103.06.10"; $x ~~ s:g/=C2=AB0+)>\d//; say "$x"'
1.0.103.6.10

What did you just do?
0
ToddAndMargo
6/13/2018 6:03:30 PM
On 06/13/2018 11:03 AM, ToddAndMargo wrote:
> On 06/13/2018 11:00 AM, Larry Wall wrote:
>> I'd probably just write something like:
>>
>> =C2=A0=C2=A0=C2=A0=C2=A0 s:g { =C2=AB <( 0+ )> \d+ =C2=BB } =3D '';
>>
>> The first <( and the last =C2=BB are not strictly necessary, but add=20
>> clarity, or
>> at least balance.=C2=A0 But in golf mode you could get away with somet=
hing=20
>> like:
>>
>> =C2=A0=C2=A0=C2=A0=C2=A0 sg/=C2=AB0+)>\d//;
>>
>> Larry
>>
>=20
>=20
> Awesome!=C2=A0 Thank you!
>=20
> $ p6 'my $x =3D "01.0.103.06.10"; $x ~~ s:g/=C2=AB0+)>\d//; say "$x"'
> 1.0.103.6.10
>=20
> What did you just do?


Sweet!

    $ p6 'my $x =3D "01.000.103.006.10"; $x ~~ s:g/=C2=AB0+)>\d//; say "$=
x"'
    1.0.103.6.10
0
ToddAndMargo
6/13/2018 6:06:00 PM
On 06/13/2018 11:06 AM, ToddAndMargo wrote:
> On 06/13/2018 11:03 AM, ToddAndMargo wrote:
>> On 06/13/2018 11:00 AM, Larry Wall wrote:

>  =C2=A0=C2=A0 $ p6 'my $x =3D "01.000.103.006.10"; $x ~~ s:g/=C2=AB0+)>=
\d//; say "$x"'
>  =C2=A0=C2=A0 1.0.103.6.10

Hi Larry,

     How did you get thee "=C2=AB" character to appear?  And
what does it mean?

Many thanks,
-T
0
ToddAndMargo
6/13/2018 6:08:47 PM
--000000000000c3746b056e89fb20
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

https://docs.perl6.org/language/unicode_entry

I have right Alt set as my Compose key, so it'd be [right-Alt] < <

(At some point I should see if I can put in some information about
WinCompose, since I think I'm currently the only one with any experience
with it.)

On Wed, Jun 13, 2018 at 2:09 PM ToddAndMargo <ToddAndMargo@zoho.com> wrote:

> On 06/13/2018 11:06 AM, ToddAndMargo wrote:
> > On 06/13/2018 11:03 AM, ToddAndMargo wrote:
> >> On 06/13/2018 11:00 AM, Larry Wall wrote:
>
> >     $ p6 'my $x =3D "01.000.103.006.10"; $x ~~ s:g/=C2=AB0+)>\d//; say =
"$x"'
> >     1.0.103.6.10
>
> Hi Larry,
>
>      How did you get thee "=C2=AB" character to appear?  And
> what does it mean?
>
> Many thanks,
> -T
>


--=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

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

<div dir=3D"ltr"><a href=3D"https://docs.perl6.org/language/unicode_entry">=
https://docs.perl6.org/language/unicode_entry</a><br><div><br></div><div>I =
have right Alt set as my Compose key, so it&#39;d be [right-Alt] &lt; &lt;<=
/div><div><br></div><div>(At some point I should see if I can put in some i=
nformation about WinCompose, since I think I&#39;m currently the only one w=
ith any experience with it.)</div></div><br><div class=3D"gmail_quote"><div=
 dir=3D"ltr">On Wed, Jun 13, 2018 at 2:09 PM ToddAndMargo &lt;<a href=3D"ma=
ilto: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:1px=
 #ccc solid;padding-left:1ex">On 06/13/2018 11:06 AM, ToddAndMargo wrote:<b=
r>
&gt; On 06/13/2018 11:03 AM, ToddAndMargo wrote:<br>
&gt;&gt; On 06/13/2018 11:00 AM, Larry Wall wrote:<br>
<br>
&gt;=C2=A0 =C2=A0=C2=A0 $ p6 &#39;my $x =3D &quot;01.000.103.006.10&quot;; =
$x ~~ s:g/=C2=AB0+)&gt;\d//; say &quot;$x&quot;&#39;<br>
&gt;=C2=A0 =C2=A0=C2=A0 1.0.103.6.10<br>
<br>
Hi Larry,<br>
<br>
=C2=A0 =C2=A0 =C2=A0How did you get thee &quot;=C2=AB&quot; character to ap=
pear?=C2=A0 And<br>
what does it mean?<br>
<br>
Many thanks,<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>

--000000000000c3746b056e89fb20--
0
allbery
6/13/2018 6:16:26 PM
On Wed, Jun 13, 2018 at 1:09 PM ToddAndMargo <ToddAndMargo@zoho.com> wrote:
>
> On 06/13/2018 11:06 AM, ToddAndMargo wrote:
> > On 06/13/2018 11:03 AM, ToddAndMargo wrote:
> >> On 06/13/2018 11:00 AM, Larry Wall wrote:
>
> >     $ p6 'my $x =3D "01.000.103.006.10"; $x ~~ s:g/=C2=AB0+)>\d//; say =
"$x"'
> >     1.0.103.6.10
>
> Hi Larry,
>
>      How did you get thee "=C2=AB" character to appear?  And
> what does it mean?
>

The way I type them is [compose] [<] [<], which is nice because their
ASCII equivalent is <<

It means match a word boundary with the word being on the right side.

    > say 'ABC DEF ' ~~ m:g/ << . /
    (=EF=BD=A2A=EF=BD=A3 =EF=BD=A2D=EF=BD=A3)
    > say 'ABC DEF ' ~~ m:g/ >> . /
    (=EF=BD=A2 =EF=BD=A3 =EF=BD=A2 =EF=BD=A3)
0
b2gills
6/13/2018 6:18:07 PM
On 06/13/2018 11:18 AM, Brad Gilbert wrote:
> On Wed, Jun 13, 2018 at 1:09 PM ToddAndMargo <ToddAndMargo@zoho.com> wr=
ote:
>>
>> On 06/13/2018 11:06 AM, ToddAndMargo wrote:
>>> On 06/13/2018 11:03 AM, ToddAndMargo wrote:
>>>> On 06/13/2018 11:00 AM, Larry Wall wrote:
>>
>>>      $ p6 'my $x =3D "01.000.103.006.10"; $x ~~ s:g/=C2=AB0+)>\d//; s=
ay "$x"'
>>>      1.0.103.6.10
>>
>> Hi Larry,
>>
>>       How did you get thee "=C2=AB" character to appear?  And
>> what does it mean?
>>
>=20
> The way I type them is [compose] [<] [<], which is nice because their
> ASCII equivalent is <<
>=20
> It means match a word boundary with the word being on the right side.
>=20
>      > say 'ABC DEF ' ~~ m:g/ << . /
>      (=EF=BD=A2A=EF=BD=A3 =EF=BD=A2D=EF=BD=A3)
>      > say 'ABC DEF ' ~~ m:g/ >> . /
>      (=EF=BD=A2 =EF=BD=A3 =EF=BD=A2 =EF=BD=A3)
>=20


$ p6 'my $x =3D "01.000.103.006.10"; $x ~~ s:g/<<0+)>\d//; say "$x"'
1.0.103.6.10

Thank you!


--=20
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
ToddAndMargo
6/13/2018 6:23:41 PM
--Apple-Mail=_B6880727-0812-4328-9932-6B4198DE606E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Now we know the meaning of >> and <<. But what about <( and )> ? What do =
they mean here?

Thanks.
Xin

> On Jun 13, 2018, at 2:18 PM, Brad Gilbert <b2gills@gmail.com> wrote:
>=20
> On Wed, Jun 13, 2018 at 1:09 PM ToddAndMargo <ToddAndMargo@zoho.com =
<mailto:ToddAndMargo@zoho.com>> wrote:
>>=20
>> On 06/13/2018 11:06 AM, ToddAndMargo wrote:
>>> On 06/13/2018 11:03 AM, ToddAndMargo wrote:
>>>> On 06/13/2018 11:00 AM, Larry Wall wrote:
>>=20
>>>    $ p6 'my $x =3D "01.000.103.006.10"; $x ~~ s:g/=C2=AB0+)>\d//; =
say "$x"'
>>>    1.0.103.6.10
>>=20
>> Hi Larry,
>>=20
>>     How did you get thee "=C2=AB" character to appear?  And
>> what does it mean?
>>=20
>=20
> The way I type them is [compose] [<] [<], which is nice because their
> ASCII equivalent is <<
>=20
> It means match a word boundary with the word being on the right side.
>=20
>> say 'ABC DEF ' ~~ m:g/ << . /
>    (=EF=BD=A2A=EF=BD=A3 =EF=BD=A2D=EF=BD=A3)
>> say 'ABC DEF ' ~~ m:g/ >> . /
>    (=EF=BD=A2 =EF=BD=A3 =EF=BD=A2 =EF=BD=A3)


--Apple-Mail=_B6880727-0812-4328-9932-6B4198DE606E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">Now =
we know the meaning of &gt;&gt; and &lt;&lt;. But what about &lt;( and =
)&gt; ? What do they mean here?<div class=3D""><br class=3D""></div><div =
class=3D"">Thanks.</div><div class=3D"">Xin<br class=3D""><div><br =
class=3D""><blockquote type=3D"cite" class=3D""><div class=3D"">On Jun =
13, 2018, at 2:18 PM, Brad Gilbert &lt;<a =
href=3D"mailto:b2gills@gmail.com" class=3D"">b2gills@gmail.com</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: STXihei; font-size: =
22px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;" class=3D"">On Wed, Jun 13, 2018 at 1:09 PM =
ToddAndMargo &lt;</span><a href=3D"mailto:ToddAndMargo@zoho.com" =
style=3D"font-family: STXihei; font-size: 22px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" =
class=3D"">ToddAndMargo@zoho.com</a><span style=3D"caret-color: rgb(0, =
0, 0); font-family: STXihei; font-size: 22px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">&gt; wrote:</span><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: STXihei; font-size: 22px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><blockquote type=3D"cite" =
style=3D"font-family: STXihei; font-size: 22px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><br class=3D"">On 06/13/2018 11:06 =
AM, ToddAndMargo wrote:<br class=3D""><blockquote type=3D"cite" =
class=3D"">On 06/13/2018 11:03 AM, ToddAndMargo wrote:<br =
class=3D""><blockquote type=3D"cite" class=3D"">On 06/13/2018 11:00 AM, =
Larry Wall wrote:<br class=3D""></blockquote></blockquote><br =
class=3D""><blockquote type=3D"cite" class=3D"">&nbsp;&nbsp;&nbsp;$ p6 =
'my $x =3D "01.000.103.006.10"; $x ~~ s:g/=C2=AB0+)&gt;\d//; say =
"$x"'<br class=3D"">&nbsp;&nbsp;&nbsp;1.0.103.6.10<br =
class=3D""></blockquote><br class=3D"">Hi Larry,<br class=3D""><br =
class=3D"">&nbsp;&nbsp;&nbsp;&nbsp;How did you get thee "=C2=AB" =
character to appear? &nbsp;And<br class=3D"">what does it mean?<br =
class=3D""><br class=3D""></blockquote><br style=3D"caret-color: rgb(0, =
0, 0); font-family: STXihei; font-size: 22px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><span style=3D"caret-color: rgb(0, 0, =
0); font-family: STXihei; font-size: 22px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">The way I type them is [compose] [&lt;] [&lt;], which is nice =
because their</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
STXihei; font-size: 22px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
STXihei; font-size: 22px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">ASCII =
equivalent is &lt;&lt;</span><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: STXihei; font-size: 22px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><br style=3D"caret-color: rgb(0, 0, =
0); font-family: STXihei; font-size: 22px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><span style=3D"caret-color: rgb(0, 0, =
0); font-family: STXihei; font-size: 22px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">It means match a word boundary with the word being on the =
right side.</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
STXihei; font-size: 22px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
STXihei; font-size: 22px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><blockquote type=3D"cite" style=3D"font-family: =
STXihei; font-size: 22px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; text-decoration: none;" class=3D"">say =
'ABC DEF ' ~~ m:g/ &lt;&lt; . /<br class=3D""></blockquote><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: STXihei; font-size: =
22px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;" class=3D"">&nbsp;&nbsp;&nbsp;(=EF=BD=A2A=EF=BD=
=A3 =EF=BD=A2D=EF=BD=A3)</span><br style=3D"caret-color: rgb(0, 0, 0); =
font-family: STXihei; font-size: 22px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""><blockquote type=3D"cite" =
style=3D"font-family: STXihei; font-size: 22px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D"">say 'ABC DEF ' ~~ m:g/ &gt;&gt; . =
/<br class=3D""></blockquote><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: STXihei; font-size: 22px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">&nbsp;&nbsp;&nbsp;(=EF=BD=A2 =EF=BD=A3 =EF=BD=A2 =
=EF=BD=A3)</span></div></blockquote></div><br =
class=3D""></div></body></html>=

--Apple-Mail=_B6880727-0812-4328-9932-6B4198DE606E--
0
xincheng99
6/13/2018 7:09:22 PM
--000000000000515a4a056e8ac675
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

https://docs.perl6.org/language/regexes#Capture_markers:_%3C(_)%3E

On Wed, Jun 13, 2018 at 3:10 PM Xin Cheng <xincheng99@gmail.com> wrote:

> Now we know the meaning of >> and <<. But what about <( and )> ? What do
> they mean here?
>
> Thanks.
> Xin
>
> On Jun 13, 2018, at 2:18 PM, Brad Gilbert <b2gills@gmail.com> wrote:
>
> On Wed, Jun 13, 2018 at 1:09 PM ToddAndMargo <ToddAndMargo@zoho.com>
> wrote:
>
>
> On 06/13/2018 11:06 AM, ToddAndMargo wrote:
>
> On 06/13/2018 11:03 AM, ToddAndMargo wrote:
>
> On 06/13/2018 11:00 AM, Larry Wall wrote:
>
>
>    $ p6 'my $x =3D "01.000.103.006.10"; $x ~~ s:g/=C2=AB0+)>\d//; say "$x=
"'
>    1.0.103.6.10
>
>
> Hi Larry,
>
>     How did you get thee "=C2=AB" character to appear?  And
> what does it mean?
>
>
> The way I type them is [compose] [<] [<], which is nice because their
> ASCII equivalent is <<
>
> It means match a word boundary with the word being on the right side.
>
> say 'ABC DEF ' ~~ m:g/ << . /
>
>    (=EF=BD=A2A=EF=BD=A3 =EF=BD=A2D=EF=BD=A3)
>
> say 'ABC DEF ' ~~ m:g/ >> . /
>
>    (=EF=BD=A2 =EF=BD=A3 =EF=BD=A2 =EF=BD=A3)
>
>
>

--=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

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

<div dir=3D"ltr"><a href=3D"https://docs.perl6.org/language/regexes#Capture=
_markers:_%3C(_)%3E">https://docs.perl6.org/language/regexes#Capture_marker=
s:_%3C(_)%3E</a><br></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">O=
n Wed, Jun 13, 2018 at 3:10 PM Xin Cheng &lt;<a href=3D"mailto:xincheng99@g=
mail.com">xincheng99@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex"><div style=3D"word-wrap:break-word;line-break:after-white-space"=
>Now we know the meaning of &gt;&gt; and &lt;&lt;. But what about &lt;( and=
 )&gt; ? What do they mean here?<div><br></div><div>Thanks.</div><div>Xin<b=
r><div><br><blockquote type=3D"cite"><div>On Jun 13, 2018, at 2:18 PM, Brad=
 Gilbert &lt;<a href=3D"mailto:b2gills@gmail.com" target=3D"_blank">b2gills=
@gmail.com</a>&gt; wrote:</div><br class=3D"m_-4636859352479054715Apple-int=
erchange-newline"><div><span style=3D"font-family:STXihei;font-size:22px;fo=
nt-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:=
normal;text-align:start;text-indent:0px;text-transform:none;white-space:nor=
mal;word-spacing:0px;text-decoration:none;float:none;display:inline!importa=
nt">On Wed, Jun 13, 2018 at 1:09 PM ToddAndMargo &lt;</span><a href=3D"mail=
to:ToddAndMargo@zoho.com" style=3D"font-family:STXihei;font-size:22px;font-=
style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:nor=
mal;text-align:start;text-indent:0px;text-transform:none;white-space:normal=
;word-spacing:0px" target=3D"_blank">ToddAndMargo@zoho.com</a><span style=
=3D"font-family:STXihei;font-size:22px;font-style:normal;font-variant-caps:=
normal;font-weight:normal;letter-spacing:normal;text-align:start;text-inden=
t:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decorati=
on:none;float:none;display:inline!important">&gt; wrote:</span><br style=3D=
"font-family:STXihei;font-size:22px;font-style:normal;font-variant-caps:nor=
mal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0=
px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:=
none"><blockquote type=3D"cite" style=3D"font-family:STXihei;font-size:22px=
;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spaci=
ng:normal;text-align:start;text-indent:0px;text-transform:none;white-space:=
normal;word-spacing:0px;text-decoration:none"><br>On 06/13/2018 11:06 AM, T=
oddAndMargo wrote:<br><blockquote type=3D"cite">On 06/13/2018 11:03 AM, Tod=
dAndMargo wrote:<br><blockquote type=3D"cite">On 06/13/2018 11:00 AM, Larry=
 Wall wrote:<br></blockquote></blockquote><br><blockquote type=3D"cite">=C2=
=A0=C2=A0=C2=A0$ p6 &#39;my $x =3D &quot;01.000.103.006.10&quot;; $x ~~ s:g=
/=C2=AB0+)&gt;\d//; say &quot;$x&quot;&#39;<br>=C2=A0=C2=A0=C2=A01.0.103.6.=
10<br></blockquote><br>Hi Larry,<br><br>=C2=A0=C2=A0=C2=A0=C2=A0How did you=
 get thee &quot;=C2=AB&quot; character to appear?=C2=A0 And<br>what does it=
 mean?<br><br></blockquote><br style=3D"font-family:STXihei;font-size:22px;=
font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacin=
g:normal;text-align:start;text-indent:0px;text-transform:none;white-space:n=
ormal;word-spacing:0px;text-decoration:none"><span style=3D"font-family:STX=
ihei;font-size:22px;font-style:normal;font-variant-caps:normal;font-weight:=
normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transfor=
m:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;=
display:inline!important">The way I type them is [compose] [&lt;] [&lt;], w=
hich is nice because their</span><br style=3D"font-family:STXihei;font-size=
:22px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-=
spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-s=
pace:normal;word-spacing:0px;text-decoration:none"><span style=3D"font-fami=
ly:STXihei;font-size:22px;font-style:normal;font-variant-caps:normal;font-w=
eight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-tr=
ansform:none;white-space:normal;word-spacing:0px;text-decoration:none;float=
:none;display:inline!important">ASCII equivalent is &lt;&lt;</span><br styl=
e=3D"font-family:STXihei;font-size:22px;font-style:normal;font-variant-caps=
:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-inde=
nt:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decorat=
ion:none"><br style=3D"font-family:STXihei;font-size:22px;font-style:normal=
;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-ali=
gn:start;text-indent:0px;text-transform:none;white-space:normal;word-spacin=
g:0px;text-decoration:none"><span style=3D"font-family:STXihei;font-size:22=
px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spa=
cing:normal;text-align:start;text-indent:0px;text-transform:none;white-spac=
e:normal;word-spacing:0px;text-decoration:none;float:none;display:inline!im=
portant">It means match a word boundary with the word being on the right si=
de.</span><br style=3D"font-family:STXihei;font-size:22px;font-style:normal=
;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-ali=
gn:start;text-indent:0px;text-transform:none;white-space:normal;word-spacin=
g:0px;text-decoration:none"><br style=3D"font-family:STXihei;font-size:22px=
;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spaci=
ng:normal;text-align:start;text-indent:0px;text-transform:none;white-space:=
normal;word-spacing:0px;text-decoration:none"><blockquote type=3D"cite" sty=
le=3D"font-family:STXihei;font-size:22px;font-style:normal;font-variant-cap=
s:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-ind=
ent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decora=
tion:none">say &#39;ABC DEF &#39; ~~ m:g/ &lt;&lt; . /<br></blockquote><spa=
n style=3D"font-family:STXihei;font-size:22px;font-style:normal;font-varian=
t-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;tex=
t-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-d=
ecoration:none;float:none;display:inline!important">=C2=A0=C2=A0=C2=A0(=EF=
=BD=A2A=EF=BD=A3 =EF=BD=A2D=EF=BD=A3)</span><br style=3D"font-family:STXihe=
i;font-size:22px;font-style:normal;font-variant-caps:normal;font-weight:nor=
mal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:n=
one;white-space:normal;word-spacing:0px;text-decoration:none"><blockquote t=
ype=3D"cite" style=3D"font-family:STXihei;font-size:22px;font-style:normal;=
font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-alig=
n:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing=
:0px;text-decoration:none">say &#39;ABC DEF &#39; ~~ m:g/ &gt;&gt; . /<br><=
/blockquote><span style=3D"font-family:STXihei;font-size:22px;font-style:no=
rmal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text=
-align:start;text-indent:0px;text-transform:none;white-space:normal;word-sp=
acing:0px;text-decoration:none;float:none;display:inline!important">=C2=A0=
=C2=A0=C2=A0(=EF=BD=A2 =EF=BD=A3 =EF=BD=A2 =EF=BD=A3)</span></div></blockqu=
ote></div><br></div></div></blockquote></div><br clear=3D"all"><div><br></d=
iv>-- <br><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmai=
l_signature"><div dir=3D"ltr"><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:allber=
y.b@gmail.com" target=3D"_blank">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 href=3D"mailto:ballbery@sinenomine.net" targe=
t=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://sineno=
mine.net" target=3D"_blank">http://sinenomine.net</a></div></div></div>

--000000000000515a4a056e8ac675--
0
allbery
6/13/2018 7:13:04 PM
Reply: