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>

<blockquote>
  <p><strong>(?=...)</strong> Positive lookahead assertion. This succeeds if the contained
  regular expression, represented here by ..., successfully matches at
  the current location, and fails otherwise. But, once the contained
  expression has been tried, the matching engine doesnât advance at all;
  the rest of the pattern is tried right where the assertion started.</p>
  
  <p><strong>(?!...)</strong> Negative lookahead assertion. This is the opposite of the
  positive assertion; it succeeds if the contained expression doesnât
  match at the current position in the string.</p>
</blockquote>

<pre><code>r"(?![aeiouyAEIOUY])[a-zA-Z])"
</code></pre>

python regex