Answer the question
In order to leave comments, you need to log in
How to correctly write a regular expression replacing the exact number of characters?
There is a regular expression that replaces everything before @ with [email protected] I would like it to be replaced not just with "[email protected]" but with the exact number of characters, tell me how to do it right about the great ones !!!
def protected_email
self.email.gsub /[^@]*@/, '[email protected]'
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question