In the documentation I read:

Use \A and \z to match the start and end of the string, ^ and $ match the start/end of a line.

I am going to apply a regular expression to check username (or e-mail is the same) submitted by user. Which expression should I use with validates_format_of in model? I can’t understand the difference: I’ve always used ^ and $ …

4 Answers
4

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *