title: perl6 regex: match all punctuations except . and "
body: <p>I read some threads on matching &quot;X except Y&quot;, but none specific to perl6. I am trying to match and replace all punctuation except . and  &quot;</p>
  <pre><code>&gt; my $a = ';# -+$12,678,93.45 &quot;foo&quot; *&amp;';
  ;# -+$12,678,93.45 &quot;foo&quot; *&amp;
  
  &gt; my $b = $a.subst(/&lt;punct - [\.\&quot;]&gt;/, &quot; &quot;, :g);
  ===SORRY!===
  Unrecognized regex metacharacter - (must be quoted to match literally)
  ------&gt; my $b = $a.subst(/&lt;punct⏏ - [\.\&quot;]&gt;/, &quot; &quot;, :g);
  Unrecognized regex metacharacter   (must be quoted to match literally)
  ------&gt; my $b = $a.subst(/&lt;punct -⏏ [\.\&quot;]&gt;/, &quot; &quot;, :g);
  Unable to parse expression in metachar:sym&lt;assert&gt;; couldn't find final '&gt;' (corresponding starter was at line 1)
  ------&gt; my $b = $a.subst(/&lt;punct - ⏏[\.\&quot;]&gt;/, &quot; &quot;, :g);
  
  &gt; my $b = $a.subst(/&lt;punct-[\.\&quot;]&gt;/, &quot; &quot;, :g);
  ===SORRY!=== Error while compiling:
  Unable to parse expression in metachar:sym&lt;assert&gt;; couldn't find final '&gt;' (corresponding starter was at line 1)
  ------&gt; my $b = $a.subst(/&lt;punct⏏-[\.\&quot;]&gt;/, &quot; &quot;, :g);
      expecting any of:
          argument list
          term
  
  &gt; my $b = $a.subst(/&lt;punct&gt;-&lt;[\.\&quot;]&gt;/, &quot; &quot;, :g);
  ===SORRY!===
  Unrecognized regex metacharacter - (must be quoted to match literally)
  ------&gt; my $b = $a.subst(/&lt;punct&gt;⏏-&lt;[\.\&quot;]&gt;/, &quot; &quot;, :g);
  Unable to parse regex; couldn't find final '/'
  ------&gt; my $b = $a.subst(/&lt;punct&gt;-⏏&lt;[\.\&quot;]&gt;/, &quot; &quot;, :g);
  
  &gt; my $b = $a.subst(/&lt;- [\.\&quot;] + punct&gt;/, &quot; &quot;, :g); # $b is blank space, not want I want
                         
  &gt; my $b = $a.subst(/&lt;[\W] - [\.\&quot;]&gt;/, &quot; &quot;, :g);
        12 678 93.45 &quot;foo&quot;   
  # this works, but clumsy; I want to 
  # elegantly say: punctuations except \, and \&quot; 
  # using predefined class &lt;punct&gt;;
  </code></pre>
  <p>What is the best approach?</p>