As someone who likes both Go and Perl 6, this reminds me a lot of Perl 6 grammars; I look forward to using this in Go. Here&#x27;s a rough equivalent in P6, although I don&#x27;t think the Go one or mine are completely legit in terms of internationalization and whatnot:<p><pre><code>  grammar email-address {
      token TOP { ^ &lt;user&gt; &#x27;@&#x27; &lt;hostname&gt; $ }
      token user { &lt;[ \w \d . _ % + - ]&gt;+ }
      token hostname { &lt;domain&gt; &#x27;.&#x27; &lt;TLD&gt; }
      token domain { \w+ }
      token TLD { \w+ }
  }

  if (my $email = email-address.parse(&#x27;joe@猫.com&#x27;)) {
      say $email&lt;user&gt;;
      say $email&lt;hostname&gt;&lt;domain&gt;;
      say $email&lt;hostname&gt;&lt;TLD&gt;;
  }
</code></pre>
It&#x27;s also possible to turn the captured parts into their own objects ($email has a type of Match; it&#x27;s not just a hash).