$str = "\\mbox{\sqrt{2}} + \sqrt{4}";
$str =~ s/
\\mbox{
  (
    (?:
      [^{}]+     #either match any number of non-braces
      |          #or
      \{[^{}]+}  #braces surrounding non-braces
    )*
  )
}
/$1/x;

print $str;