Python version of Java regular expression?
<p>I am a Java developer, and new to Python. I would like to define a regex accepting all the alphabetic characters except for some of them. I want to exclude just the vowels and the character 'y', be it in upper- or lowercase. </p>

<p>The regex in Java for it would be as follows:</p>

<pre><code> "[a-zA-Z&amp;&amp;[^aeiouyAEIOUY]]"
</code></pre>

<p>How can I (re)define it as in Python? The above doesn't work for Python, obviously. And I also would <strong>NOT</strong> like the following pattern to be suggested:</p>

<pre><code>"[bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ]"
</code></pre>

<p>Like <code>(?i)[b-df-hj-np-tv-xz]</code> or <code>(?i)\w(?&lt;![_aeiouy\d])</code>. Test <a href="https://regex101.com/#python" rel="nofollow">here</a>.</p>

python regex