Hi All,

I am trying to change the last three letters of a string

$ perl6 -e 'my $x="abcabcabc"; $x ~~ s/"a.*"$/xyz/; say $x;'
abcabcabc

I want abcabcxyz

And, in real life, only the "a" will be a know letter.
Everything else will vary.  And the "a" will repeat a lot.
I am only interested in changing the last "a" and everything
that comes after it.

Many thanks,
-T

Reply via email to