develooper Front page | perl.perl6.users | Postings from February 2019

How do I use chr inside a regex?

Thread Next
From:
ToddAndMargo via perl6-users
Date:
February 2, 2019 06:48
Subject:
How do I use chr inside a regex?
Message ID:
c1a23e0c-05d7-3616-2f0e-fc77541e3b6f@zoho.com
Hi All,

How do I use chr inside a regex.  In the below, how
do I get rid of $y?

$ p6 'my Str $x=chr(0x66)~chr(0x77); my Str $y=chr(0x66)~chr(0x77); 
$x~~s/ $y /xy/; say $x;'

xy


Many thanks,
-T

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About