How can I rewrite a URL in Wordpress with a query variable that uses both letters and numbers?
<p>I want to write a custom redirect in Wordpress with a page and URL parameter. Basically, I want <code>/property/ABC123</code> to go to <code>index.php?pagename=property&amp;my_id=ABC123</code>. This is what I have, but I think my regex is off.</p>

<pre><code>public function custom_rewrite_tag() {
    add_rewrite_tag('%my_id%', '([^&amp;]+)');
}

public function custom_rewrite_rule() {
    add_rewrite_rule('^property/([^/]*)/?', 'index.php?pagename=property&amp;my_id=$matches[1]', 'top');
}

add_action('init', [$this, 'custom_rewrite_tag'], 10, 0);
add_action('init', [$this, 'custom_rewrite_rule'], 10, 0);
</code></pre>

<p>I've refreshed my permalinks but this does not work. I also tried removing the underscore (<code>myid</code>), but that didn't work either. What am I doing wrong?</p>