Regex Pattern for Philippine Phone Number -
there 2 types of phone number in philippines.
first type = start 09
followed 9
numbers. did this. pattern this.
^(09)\\d{9}
and working.
second type = start +639
followed 9
numbers. example +6391571825
. can't identify pattern because has special character. pattern this?
just escape special character , place in alternation as
^(09|\+639)\d{9}$
(09|\+639)
alternation matches either09
or+639
$
anchors regex @ end of string. ensures no more digits can appear after 9 characters.
Comments
Post a Comment