'Regex : Phone number with country code is required [duplicate]

I want to set regex like with phone number country code must be required. I applied regex, but it's not working.

What I have tried :

/\A\+\d{1,3}-\d{10}\z/
/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/

Both, are not working.

Can anyone please suggest me to create regex about phone number with country code?

Thanks.

Phone number example :

+91-1234567890
+971-564150430

I know there are regex solution available. But, it's not working for me.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source