Skip to content

Commit f8958d8

Browse files
committed
Merge pull request #141 from Fryguy/email_regexp
Fix literal . in email regex
2 parents 0e75637 + e1ece76 commit f8958d8

File tree

1 file changed

+1
-1
lines changed
  • lib/more_core_extensions/core_ext/string

1 file changed

+1
-1
lines changed

lib/more_core_extensions/core_ext/string/formats.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module MoreCoreExtensions
22
module StringFormats
33
# 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
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
55

66
def email?
77
!!(self =~ RE_EMAIL)

0 commit comments

Comments
 (0)