I'm working with the following regex (taken from the devise.rb
file that devise generates):
\A[^@\s]+@[^@\s]+\z
Usually, when I'm learning about a regex I use rubular. For example, if I wanted to learn about the regex /.a./
, I would set up my workspace as shown here:
Notice how I'm using multiple examples:
foo
bar
baz
And rubular is giving me feedback that both bar
and baz
match.
Now I'd like to learn about the regex that devise generates: /\A[^@\s]+@[^@\s]+\z/
. So I set up my rubular workspace as shown here here:
There isn't a match. It's because I have two examples:
foo@foo.com
cats@cat.com
But I was expecting them both to match. Why aren't both test strings matching?