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

Need help with a regex

Thread Next
From:
ToddAndMargo via perl6-users
Date:
May 7, 2019 03:10
Subject:
Need help with a regex
Message ID:
65afe35c-61ce-2ac3-74d0-1a8ca5edaf06@zoho.com
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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