I have a string that I want to make sure that the format is always a + followed by digits. The following would work:
+
String parsed = input
What about just
(?!^)\D+
Java string:
"(?!^)\\D+"
Demo at regex101.com
\D matches a character that is not a digit [^0-9]
\D
[^0-9]
(?!^) using a negative lookahead to check, if it is not the initial character
(?!^)