Today my commit was merged into Rails master, yay!
The issue can’t really be “fixed” because it’s not really a bug. It’s just that Ruby has different defaults regarding multi-line mode in regular expressions than some other languages. What I did was just let programmers know if they are using the ^ or $ anchors in regular expressions they put into Rails’ validates_format_of. Most likely, they are using them because they copied the RegExp somewhere from the web or they forgot about how Ruby understands these anchors. There is really almost no use case to use ^ or $ in validates_format_of. So this solution is kind of harmless. If you actually do need to use ^ or $, simply add :multiline => true to your format validator, and the exception goes away. But do think first if you really need it, because chances are you want to use A and z.