probably a bit more readable as

    regex += (real < 0 ? "[-\\u2212]\\s*" + (-real) : real) + "\\s*$";