Smarter regex check (is_regex)

Improve according to latest documentation and real life usage examples.