Regular expressions to check for + sign

Solution 1:

Your first alternative allows only optional digits without any plus sign.

You can write the pattern as

^[0-9]*[+]$|^[+][0-9]*$|^[0-9]*[+][0-9]*$

Or shorten it to

^\d*\+\d*$

Note that both pattern allow only a + without any digits.

See a regex demo.