Skip to content

Commit

Permalink
Make the login and email regex's javascript compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
josephruscio authored and binarylogic committed Nov 12, 2009
1 parent 0ac3088 commit 8242002
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/authlogic/regex.rb
Expand Up @@ -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.