I think you can combine a contains and a length statement, that would give the result you need:
You can force all lowercase on a string. Check out the toLowerCase() documentation. You can use this on both the input and account email fields for your check.
I think you are going to need to normalise your data so both the stored email address and the entered email address are in the same format.
To normalise i’d look at converting to lowercase and trimming whitespace so they are consistent. This probably means updating the email address you have stored for existing users.
Hope this helps.
You could do a “contains” xpath, but this could retrieve more than you bargain for. You’d have to do a subsequent check converting both to upper or lower case to confirm it is indeed a match