As for making hi-lock-mode detect whether or not a regexp is multi-line, isn't that a computationally non-trivial problem?Well, you can turn the regexp into a DFA, then take the ".*\n.+" regexp, turn it into another DFA, take the intersection of the two DFAs, and if it's empty you know your regexp can never match a multiline element.