We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
::URI::MailTo::EMAIL_REGEXP == /\A[a-zA-Z0-9.!\#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\z/
Using the Regexp object works just fine. However, using the source in a rails query points out the error in the \z escape squence at the end..
\z
User.where("email ~* ?", ::URI::MailTo::EMAIL_REGEXP) results in the following error:
User.where("email ~* ?", ::URI::MailTo::EMAIL_REGEXP)
ActiveRecord::StatementInvalid: PG::InvalidRegularExpression: ERROR: invalid regular expression: invalid escape \ sequence
::URI::MailTo::EMAIL_REGEXP.source == "\\A[a-zA-Z0-9.!\\\#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\\z"
The query is successful when I swap the lowercase z for an uppercase Z.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Using the Regexp object works just fine. However, using the source in a rails query points out the error in the
\z
escape squence at the end..User.where("email ~* ?", ::URI::MailTo::EMAIL_REGEXP)
results in the following error:ActiveRecord::StatementInvalid: PG::InvalidRegularExpression: ERROR: invalid regular expression: invalid escape \ sequence
The query is successful when I swap the lowercase z for an uppercase Z.
The text was updated successfully, but these errors were encountered: