Hi All,

I am trying to change

     /

into

     \\\

This works:


$ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\\\\\|;print $x ~ "\n"'
a\\\b\\\c\\\d


But this does not:

$ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|Q[\\\]|;print $x ~ "\n"'
aQ[\]bQ[\]cQ[\]d


How do I put a literal string in the
target of a regex?

Many thanks,
-T

Reply via email to