Skip to content

Conversation

aditya241104
Copy link

Problem
Current regex /\(?\d{3}\)?[\s-]?\d{3}[\s-]?\d{4}/ is too restrictive for international phone numbers. Numbers with country codes like +91 98765 43210 are detected with confidence 0 instead of being properly parsed.

Solution

  • Added support for international formats with country codes (+91, +1, +44, etc.)
  • Maintained backward compatibility with existing US phone formats
  • Uses fallback approach to ensure no existing functionality is broken

Testing
Verified with resume parser at localhost:3000/resume-parser:

  • +91 98765 43210 (Indian format) - now parses correctly
  • +1 555 123 4567 (US with country code) - now parses correctly
  • (123) 456-7890 (existing US format) - still works
  • 123-456-7890 (existing US format) - still works

Before/After

  • Before: International numbers showed confidence 0, not parsed
  • After: International numbers properly extracted with correct confidence

Fixes #146

- Add support for international phone numbers with country codes
- Maintains backward compatibility with US phone formats
- Fixes parsing confidence issues for non-US numbers

Fixes xitanggg#146
Copy link

vercel bot commented Aug 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
open-resume Ready Ready Preview Comment Aug 20, 2025 4:13pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The phone number regex is too rigid
1 participant