Fix security warning from Rails 4 related to regepx anchors

`^` and `$` allow for multiline strings to slip unsanitized lines through:

```
2.1.2 :001 > "hello\nthere".match(/^[a-z]+$/)
 => #<MatchData "hello"> 
```

We obviously don't want students to submit [Bobby Tables](http://xkcd.com/327/). `\A` and `\z` match the entire string and is the recommended way to sanitize the input in Rails 4.