Skip to content

function isPhoneNumber regex #1

Closed
@ngmisl

Description

@ngmisl

Tried the extension, but it seems to have very weak phone number recognition, here's some recommendation (by GPT4)

const phoneRegex = /((\+|00)(\d{1,3}))?[-.\s]?(\()?(\d{1,4})(?(4)\))[-.\s]?(\d{1,4})[-.\s]?(\d{4,7})/g;

This regex pattern will detect phone numbers in the following formats:

  • +1 (123) 456-7890
  • +1-123-456-7890
  • +1.123.456.7890
  • +1 123 456 7890
  • 123-456-7890
  • 123.456.7890
  • 123 456 7890
  • (123) 456-7890
  • 00123 456 7890
  • 00123-456-7890
  • 00123.456.7890
  • 00(123) 456-7890

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions