I'd (wildly) guess that this is part of a routine that handles numbers with the code provided executing the block of code only when there is not a valid exponent. An exponent is (typically) such a simple number as that being matched, a signed or unsigned (+/-) integer.
the hardest line to type correctly is: stty erase ^H