I have the following regular expression in our Rails code:
validates :what_is_the_break_divers_creed,
format: { with: /^No[\s]*Rules[\s]*\.?[\s]*No[\s]*Excuses[\s]*\.?[\s]*No[\s]*Regrets[\s]*\.?\z/i }
I am receiving the following error:
The provided regular expression is using multiline anchors (^ or $),
which may present a security risk. Did you mean to use \A and \z,
or forgot to add the :multiline => true option?
I do have the \z tag, but is it conflicting with the /i tag? Do you see anything wrong with this regular expression that we are doing incorrectly? Why does it think we are using multiline anchors---are we? Would \A\z solve the issue? Should I remove the ^? It seems like it may, but I can't say for certain due to another issue in the same model that we are also working on.
I have read through many other rails regex issues here on S.O., but don't seem to find one that matches the above situation precisely.
Thank you for your help!