The .*? expression is not matching anything. I think you want to use .+
perl6 -e 'my $x="\$1.23"; $x~~s/("\$") (.*?)/$0:$1:USD/; say $x;'
$::USD1.23
perl6 -e 'my $x="\$1.23"; $x~~s/ \$(.+) /$0USD/; say $x'
1.23USD
On Tue, 7 May 2019 at 13:10, ToddAndMargo via perl6-users <
[email protected]> wrote:
> Hi All,
>
> What am I doing wrong here?
>
> $ p6 'my $x="\$1.23"; $x~~s/("\$") (.*?)/$1USD/; say $x;'
> USD1.23
>
> I am expecting to see `1.23USD`
>
> Many thanks,
> -T
>
>
>
>
>
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Computers are like air conditioners.
> They malfunction when you open windows
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia
[email protected] 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