Im using validates_format_of method to check email format:
validates_format_of :email, :with => /^([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})$/i
The reason is that you are converting your regular expression using .to_s instead of .inspect. What you need to do in your view is use .inspect to get the proper format. Here is some sample code that should explain the issue:
email = /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
email.to_s #"(?i-mx:^([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})$)"
email.inspect #"/^([^@\\s]+)@((?:[-a-z0-9]+\\.)+[a-z]{2,})$/i"
so, in your javascript view do something like this to get the actual string representation you want:
<%= email.inspect %>