If a string is enclosed in ' characters, and I want to remove the bracketing ', how do I do it?

Seems like ' is not a normal character, or is it because its not a bracketing character?

Using REPL I got

> my $s = '\'<favicon />\''
'<favicon />'
> $s.subst( / \' ~ \' (.+) /, $0)
Use of Nil in string context
  in block <unit> at <unknown file> line 1

> my $t = '{<favicon />}'
{<favicon />}
> $t.subst( / \{ ~ \} (.+) /, $0)
<favicon />


For clarity

raku -v

Welcome to Rakudo™ v2021.12.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2021.12.


Reply via email to