cerebras-nidhip/SWE-bench-JS huggingface dataset:
Repository: validatorjs/validator.js

Issue:
French VAT number
**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})$/


Discussion:
I’d like to take this issue and open a PR with the fix.
> I’d like to take this issue and open a PR with the fix.

Feel free to apply the fix. The first good PR will be taken on board and accepted by maintainers. I've indicated the possible solution in the description. If you open the PR, tag this issue so we can have a direct link.



Patch:
diff --git a/src/lib/isVAT.js b/src/lib/isVAT.js
index 50fcf52e0..1ec2c5991 100644
--- a/src/lib/isVAT.js
+++ b/src/lib/isVAT.js
@@ -60,7 +60,7 @@ export const vatMatchers = {
   DK: str => /^(DK)?\d{8}$/.test(str),
   EE: str => /^(EE)?\d{9}$/.test(str),
   FI: str => /^(FI)?\d{8}$/.test(str),
-  FR: str => /^(FR)?\w{2}\d{9}$/.test(str),
+  FR: str => /^(FR)([A-Z0-9]{2}\d{9})$/.test(str),
   DE: str => /^(DE)?\d{9}$/.test(str),
   EL: str => /^(EL)?\d{9}$/.test(str),
   HU: str => /^(HU)?\d{8}$/.test(str),


Test patch:
diff --git a/test/validators.test.js b/test/validators.test.js
index f73a48164..f474338dd 100644
--- a/test/validators.test.js
+++ b/test/validators.test.js
@@ -15055,11 +15055,18 @@ describe('Validators', () => {
       args: ['FR'],
       valid: [
         'FRAA123456789',
-        'AA123456789',
+        'FR83404833048',
+        'FR40123456789',
+        'FRA1123456789',
+        'FR1A123456789',
       ],
       invalid: [
         'FR AA123456789',
         '123456789',
+        'FRAA123456789A',
+        'FR123456789',
+        'FR 83404833048',
+        'FRaa123456789',
       ],
     });
     test({