I'm trying to write a regex to allow phone country codes in this format: +NNNN, where N is a number. I tried with this one but it didn't work:
/^\\+|[0-9]+$/
What is wrong?
What about that?
/^\+[0-9]{1,4}$/
+9 or +99, which is not what the OP asks?+NNNN but also NNNNN in this way only the first one is allowed, how I can fix that? I tough for that reason I had the | pipe
/^\\+[0-9]{4}$/?