-
Notifications
You must be signed in to change notification settings - Fork 31
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
Changing phone number validation pattern to allow extensions #498
Conversation
@jacobyavis @pjohnmeyer - looking for review/approval. |
@jacobyavis @pjohnmeyer - please review/approve. Thanks! |
schema/types/Phone.schema.json
Outdated
"type": "string", | ||
"pattern": "^\\+\\d{1,3}\\s\\d{2,3}\\s\\d{2,3}\\s\\d{4}$" | ||
"pattern": "^\\+\\d{1,3}\\s\\d{2,3}\\s\\d{2,3}\\s\\d{4}(?:\\s(ext.|extension)\\s\\d+)?$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the TWG call, the lookahead seems unnecessary.
^\+\d{1,3}\s\d{2,3}\s\d{2,3}\s\d{4}(\s(ext.|extension)\s\d+)?$
seems to work fine.
schema/types/Phone.schema.json
Outdated
"type": "string", | ||
"pattern": "^\\+\\d{1,3}\\s\\d{2,3}\\s\\d{2,3}\\s\\d{4}$" | ||
"pattern": "^\\+\\d{1,3}\\s\\d{2,3}\\s\\d{2,3}\\s\\d{4}(?:\\s(ext.|extension)\\s\\d+)?$" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TWG Notes: See if the lookahead ?:
at the beginning here is actually necessary, it seems redundant with the trailing ?
. Also I don't believe JSON-schema patterns support ?:
see https://json-schema.org/understanding-json-schema/reference/regular_expressions
… number regex pattern
Pushed a change to remove the unnecessary lookahead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preparing to merge
What type of PR is this?
Phone number validation pattern updated to allow extensions after the phone number.