I am trying to make a regular expression that matches Singapore phone numbers. The key part is that the numbers may or may not have spaces in between.
My requirements are:
- The number should start with
+65
. - The next number should be either
6
,8
, or9
. - The next 7 characters should be any digit from
0
to9
.
For example: +6581234567
I searched through Stack Overflow and found this question which does the exact same thing above.
Now like I said above, there could be spaces in between. And I'm not sure how to do the spaces. So the possible combinations are these two.
+6581234567
+65 8123 4567