We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 0e75637 + e1ece76 commit f8958d8Copy full SHA for f8958d8
lib/more_core_extensions/core_ext/string/formats.rb
@@ -1,7 +1,7 @@
1
module MoreCoreExtensions
2
module StringFormats
3
# From: http://www.regular-expressions.info/email.html
4
- RE_EMAIL = %r{\A[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\z}i
+ RE_EMAIL = %r{\A[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\z}i
5
6
def email?
7
!!(self =~ RE_EMAIL)
0 commit comments