Changing const_regexp to check for constant name.

We need to return Regexp.escape(camel_cased_word)
if the split is blank.
Merge pull request #10946 from arunagw/build_fix_for_object_const_get_nil

We need to check exception name to be nil