Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update phone_numbers.py
Adding Regex for Phone Numbers in EGYPT
  • Loading branch information
ahmeda335 authored Aug 27, 2024
commit b7b695af2330057b53887071007d5e5f897c3599
8 changes: 8 additions & 0 deletions outlines/types/phone_numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@
str,
WithJsonSchema({"type": "string", "pattern": US_PHONE_NUMBER}),
]

# Phone numbers in Egypt.
EGYPT_PHONE_NUMBER = r"^01[0-2,5]{1}[0-9]{8}$"

EgpytPhoneNumber = Annotated[
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EgyptPhoneNumber

str,
WithJsonSchema({"type": "string", "pattern": EGYPT_PHONE_NUMBER}),
]