Here is a regex that captures all examples you have given:
/^((\+|\+\(\d\d\)|)\d+)$/mg
Here you can check out the regex in action, the group zero results are what you are looking for:
const regex = /^((\+|\+\(\d\d\)|)\d+)$/mg;
const str = `3323652369
+(33)2342342
45646
+3453535`;
let m;
while ((m = regex.exec(str)) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
It just takes all the special cases you showcased and allows you to pick any of them followed by any amount of numbers. This solution isn't very scalable and resilient though. Phone numbers can take many different forms, they might contain spaces or '/'-symbols for example.
You should look into specifying what forms your phone numbers can take more precisely, that will allow you/us to devolop a better solution. The links you have been given in the comments are a good starting point for that.