-
Notifications
You must be signed in to change notification settings - Fork 842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let for the phoneNumber() and cellPhone() methods put a format #380
Comments
@manueljordan You may want to take a look at the data underlying this API. It was not designed for arbitrary digits with a regex-like pattern. I too would like to be able to specify a format, but my need is mainly for delimiter differences. Take a look at this file in the project: I'm assuming those formats are common to a non-US country. I did not look into the other configuration files in that directory, but maybe you can get what you need by adding to one of the YML files in there. |
Hello @kellerj , yes, I saw that file, sadly in my country the patterns numbers change for each city. It about two important things:
And even more, would be: (054)-226711 or (051)-2588769 Thus I need set the length or pattern manually (and restrict the two first digits) |
Hi, is there an option to generate fake cellPhone() that will contain country code all the time? |
Is this feature support to international phone prefix or numbers? I am thinking here of the plus sign. |
You can use a regex directly:
I suggest this one: https://phoneregex.com/ |
I am playing a lot with this wonderful library, thanks for this tool
Well, I am working in peace until some point with:
faker.phoneNumber().cellPhone()
faker.phoneNumber().phoneNumber()
Just curious if I can set the phone number or cell phone format prior to be generated to the following patterns:
######
(possible in someway just withfaker.numerify("######")
)##-##-##
(possible in someway just withfaker.numerify("##-##-##")
)Even better to something like: (mostly I need this)
[2-4]#-##-##
to get valid just: (22-67-11 * 23-88-99 * 38-20-15 * 43-98-44 )[2-4]#####
to get valid just: (226711 * 238899 * 382015 * 439844 )Therefore something to:
faker.phoneNumber().cellPhone([2-4]#-##-##)
faker.phoneNumber().phoneNumber([2-4]#####)
Thus I am not sure if is possible (if yes - how can be configured?) and if not, consider add this feature
Thanks for your understanding
The text was updated successfully, but these errors were encountered: