Sitelet https://github.com/validatorjs/validator.js/issues/2582
Skip to content

French VAT number #2582

Description

@aparzi

Describe the bug
The French VAT regular expression is invalid. The number begins with the FR code, followed by a two-digit key and the company's nine-digit SIREN number. For example, here are two intra-community VAT numbers: FR 89 128370925 and FR 10 123456789.

With the current regex, I can create a VAT number with the following format: FR_9128370925

Examples

Regular expression with problem: FR: str => /^(FR)?\w{2}\d{9}$/.test(str),
Solution: /^(FR)([A-Z0-9]{2}\d{9})$/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions