I have this raw mysql query, SELECT user_id FROM user WHERE email_address NOT REGEXP '[^@]+@[^@]+\.[^@]+', this filters all email addresses having invalid email addresses.
I will need an SQLAlchemy equivalent for this.
I have tried this query, User.query.filter(User.email_address.op('regexp')(r'[^@]+@[^@]+\.[^@]+')).all(), but it filters all the valid email addresses. I just need to know how to add the NOT in this query.
sqlalchemy.not()?