Skip to content
Browse files

Merge pull request #5 from opsidao/patch-1

Fix wrong regexp for Belgium numbers
  • Loading branch information...
2 parents 4ff19d8 + 55843d7 commit 3f5c7e79304e184a00221798f686d53b5de04c02 @yolk committed Apr 10, 2012
Showing with 2 additions and 1 deletion.
  1. +1 −1 lib/valvat/syntax.rb
  2. +1 −0 spec/valvat/syntax_spec.rb
View
2 lib/valvat/syntax.rb
@@ -5,7 +5,7 @@ module Syntax
VAT_PATTERNS = {
'AT' => /\AATU[0-9]{8}\Z/, # Austria
- 'BE' => /\ABE[0-9]{10}\Z/, # Belgium
+ 'BE' => /\ABE0[0-9]{9}\Z/, # Belgium
'BG' => /\ABG[0-9]{9,10}\Z/, # Bulgaria
'CY' => /\ACY[0-9]{8}[A-Z]\Z/, # Cyprus
'CZ' => /\ACZ[0-9]{8,10}\Z/, # Czech Republic
View
1 spec/valvat/syntax_spec.rb
@@ -24,6 +24,7 @@
Valvat::Syntax.validate("BE081733199").should eql(false)
Valvat::Syntax.validate("BE08173319944").should eql(false)
Valvat::Syntax.validate("BE081733199H").should eql(false)
+ Valvat::Syntax.validate("BE1817331999").should eql(false)
end
it "validates a BG vat number" do

0 comments on commit 3f5c7e7

Please sign in to comment.
Something went wrong with that request. Please try again.