Trying to create a regular expression for a specific country code and phone number format.
const regexCountryCode = new RegExp('^\\+(48)[0-9]{9}$');
console.log( regexCountryCode.test(String(+48124223232)) );
My goal is to validate a string that starts with a plus sign, followed by the country code 48, and then 9 digits.
When I test this regex on https://regex101.com/, it shows as correct. However, when I implement it in Angular using TypeScript, I get 'false' in the console output.
What could be going wrong here?