Permalink
Browse files

Make the login and email regex's javascript compatible

  • Loading branch information...
josephruscio authored and binarylogic committed Nov 8, 2009
1 parent 0ac3088 commit 8242002bb6c2b9eb933084830b1b8f749e14da6f
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/authlogic/regex.rb
View
@@ -13,13 +13,13 @@ def self.email
email_name_regex = '[A-Z0-9_\.%\+\-]+'
domain_head_regex = '(?:[A-Z0-9\-]+\.)+'
domain_tld_regex = '(?:[A-Z]{2,4}|museum|travel)'
- @email_regex = /\A#{email_name_regex}@#{domain_head_regex}#{domain_tld_regex}\z/i
+ @email_regex = /^#{email_name_regex}@#{domain_head_regex}#{domain_tld_regex}$/i
end
# A simple regular expression that only allows for letters, numbers, spaces, and .-_@. Just a standard login / username
# regular expression.
def self.login
- /\A\w[\w\.+\-_@ ]+\z/
+ /^\w[\w\.+\-_@ ]+$/
end
end
-end
+end

0 comments on commit 8242002

Please sign in to comment.