Skip to content

Commit

Permalink
fields: Update regex pattern for e-mail addresses (TEDEFO-2654)
Browse files Browse the repository at this point in the history
This allows more special characters in the local part.

Also update corresponding schematron rules.
  • Loading branch information
bertrand-lorentz committed Sep 21, 2023
1 parent 7a8b4d4 commit 0ca2502
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions fields/fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -22390,7 +22390,7 @@
} ]
},
"pattern" : {
"value" : "^[a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,63}$",
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -22427,7 +22427,7 @@
} ]
},
"pattern" : {
"value" : "^[a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,63}$",
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -22455,7 +22455,7 @@
} ]
},
"pattern" : {
"value" : "^[a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,63}$",
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -22483,7 +22483,7 @@
} ]
},
"pattern" : {
"value" : "^[a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,63}$",
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"severity" : "ERROR"
}
}, {
Expand Down
8 changes: 4 additions & 4 deletions schematrons/dynamic/validation-stage-3b.sch
Original file line number Diff line number Diff line change
Expand Up @@ -1805,19 +1805,19 @@
<assert id="BT-505-Organization-TouchPoint_length" role="ERROR" test="string-length(normalize-space(.)) le 400">rule|text|BT-505-Organization-TouchPoint_length</assert>
</rule>
<rule context="/*/cac:BusinessParty/cac:Contact/cbc:ElectronicMail">
<assert id="BR-BT-00506-0208" role="ERROR" test="matches(normalize-space(.),'^[a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$')">rule|text|BR-BT-00506-0208</assert>
<assert id="BR-BT-00506-0208" role="ERROR" test="matches(normalize-space(.),'^[A-Za-z0-9!#$%&amp;''*+/=?_-]+(\.[A-Za-z0-9!#$%&amp;''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\.)+([A-Za-z]{2,})$')">rule|text|BR-BT-00506-0208</assert>
<assert id="BT-506-Business_length" role="ERROR" test="string-length(normalize-space(.)) le 400">rule|text|BT-506-Business_length</assert>
</rule>
<rule context="/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Organizations/efac:Organization/efac:Company/cac:Contact/cbc:ElectronicMail">
<assert id="BR-BT-00506-0052" role="ERROR" test="matches(normalize-space(.),'^[a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$')">rule|text|BR-BT-00506-0052</assert>
<assert id="BR-BT-00506-0052" role="ERROR" test="matches(normalize-space(.),'^[A-Za-z0-9!#$%&amp;''*+/=?_-]+(\.[A-Za-z0-9!#$%&amp;''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\.)+([A-Za-z]{2,})$')">rule|text|BR-BT-00506-0052</assert>
<assert id="BT-506-Organization-Company_length" role="ERROR" test="string-length(normalize-space(.)) le 400">rule|text|BT-506-Organization-Company_length</assert>
</rule>
<rule context="/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Organizations/efac:Organization/efac:TouchPoint/cac:Contact/cbc:ElectronicMail">
<assert id="BR-BT-00506-0104" role="ERROR" test="matches(normalize-space(.),'^[a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$')">rule|text|BR-BT-00506-0104</assert>
<assert id="BR-BT-00506-0104" role="ERROR" test="matches(normalize-space(.),'^[A-Za-z0-9!#$%&amp;''*+/=?_-]+(\.[A-Za-z0-9!#$%&amp;''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\.)+([A-Za-z]{2,})$')">rule|text|BR-BT-00506-0104</assert>
<assert id="BT-506-Organization-TouchPoint_length" role="ERROR" test="string-length(normalize-space(.)) le 400">rule|text|BT-506-Organization-TouchPoint_length</assert>
</rule>
<rule context="/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Organizations/efac:UltimateBeneficialOwner/cac:Contact/cbc:ElectronicMail">
<assert id="BR-BT-00506-0156" role="ERROR" test="matches(normalize-space(.),'^[a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$')">rule|text|BR-BT-00506-0156</assert>
<assert id="BR-BT-00506-0156" role="ERROR" test="matches(normalize-space(.),'^[A-Za-z0-9!#$%&amp;''*+/=?_-]+(\.[A-Za-z0-9!#$%&amp;''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\.)+([A-Za-z]{2,})$')">rule|text|BR-BT-00506-0156</assert>
<assert id="BT-506-UBO_length" role="ERROR" test="string-length(normalize-space(.)) le 400">rule|text|BT-506-UBO_length</assert>
</rule>
<rule context="/*/cac:ContractingParty/cbc:BuyerProfileURI">
Expand Down
8 changes: 4 additions & 4 deletions schematrons/static/validation-stage-3b.sch
Original file line number Diff line number Diff line change
Expand Up @@ -1805,19 +1805,19 @@
<assert id="BT-505-Organization-TouchPoint_length" role="ERROR" test="string-length(normalize-space(.)) le 400">rule|text|BT-505-Organization-TouchPoint_length</assert>
</rule>
<rule context="/*/cac:BusinessParty/cac:Contact/cbc:ElectronicMail">
<assert id="BR-BT-00506-0208" role="ERROR" test="matches(normalize-space(.),'^[a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$')">rule|text|BR-BT-00506-0208</assert>
<assert id="BR-BT-00506-0208" role="ERROR" test="matches(normalize-space(.),'^[A-Za-z0-9!#$%&amp;''*+/=?_-]+(\.[A-Za-z0-9!#$%&amp;''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\.)+([A-Za-z]{2,})$')">rule|text|BR-BT-00506-0208</assert>
<assert id="BT-506-Business_length" role="ERROR" test="string-length(normalize-space(.)) le 400">rule|text|BT-506-Business_length</assert>
</rule>
<rule context="/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Organizations/efac:Organization/efac:Company/cac:Contact/cbc:ElectronicMail">
<assert id="BR-BT-00506-0052" role="ERROR" test="matches(normalize-space(.),'^[a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$')">rule|text|BR-BT-00506-0052</assert>
<assert id="BR-BT-00506-0052" role="ERROR" test="matches(normalize-space(.),'^[A-Za-z0-9!#$%&amp;''*+/=?_-]+(\.[A-Za-z0-9!#$%&amp;''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\.)+([A-Za-z]{2,})$')">rule|text|BR-BT-00506-0052</assert>
<assert id="BT-506-Organization-Company_length" role="ERROR" test="string-length(normalize-space(.)) le 400">rule|text|BT-506-Organization-Company_length</assert>
</rule>
<rule context="/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Organizations/efac:Organization/efac:TouchPoint/cac:Contact/cbc:ElectronicMail">
<assert id="BR-BT-00506-0104" role="ERROR" test="matches(normalize-space(.),'^[a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$')">rule|text|BR-BT-00506-0104</assert>
<assert id="BR-BT-00506-0104" role="ERROR" test="matches(normalize-space(.),'^[A-Za-z0-9!#$%&amp;''*+/=?_-]+(\.[A-Za-z0-9!#$%&amp;''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\.)+([A-Za-z]{2,})$')">rule|text|BR-BT-00506-0104</assert>
<assert id="BT-506-Organization-TouchPoint_length" role="ERROR" test="string-length(normalize-space(.)) le 400">rule|text|BT-506-Organization-TouchPoint_length</assert>
</rule>
<rule context="/*/ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/efext:EformsExtension/efac:Organizations/efac:UltimateBeneficialOwner/cac:Contact/cbc:ElectronicMail">
<assert id="BR-BT-00506-0156" role="ERROR" test="matches(normalize-space(.),'^[a-zA-Z0-9][a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,63}$')">rule|text|BR-BT-00506-0156</assert>
<assert id="BR-BT-00506-0156" role="ERROR" test="matches(normalize-space(.),'^[A-Za-z0-9!#$%&amp;''*+/=?_-]+(\.[A-Za-z0-9!#$%&amp;''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\.)+([A-Za-z]{2,})$')">rule|text|BR-BT-00506-0156</assert>
<assert id="BT-506-UBO_length" role="ERROR" test="string-length(normalize-space(.)) le 400">rule|text|BT-506-UBO_length</assert>
</rule>
<rule context="/*/cac:ContractingParty/cbc:BuyerProfileURI">
Expand Down

0 comments on commit 0ca2502

Please sign in to comment.