improved regex for issuer_name and issuer_address

This commit is contained in:
Aljaž Starc
2022-09-08 17:47:37 +00:00
parent 19aa9a0c7d
commit 4203c225a8
2 changed files with 8 additions and 8 deletions

View File

@@ -38,8 +38,8 @@ app.get('/api/qrcode', async (req, res) => {
check('payment_purpose', /^.{1,42}$/i)
check('iban', /^[A-Z]{2}\d{17}$/)
check('reference', /^[A-Z]{2}[0-9\-]{1,24}$/)
check('issuer_name', /^[a-zA-Z0-9ČŠŽĐ.'](?:[A-Z0-9 ČŠŽĐ.']{0,31}[A-Z0-9ČŠŽĐ.'])?$/i)
check('issuer_address', /^[a-zA-Z0-9ČŠŽĐ](?:[A-Z0-9 ČŠŽĐ]{0,31}[A-Z0-9ČŠŽĐ])?$/i)
check('issuer_name', /^[a-zA-Z0-9ČŠŽĐ.'](?:[A-Z0-9 ČŠŽĐ.'\-]{0,31}[A-Z0-9ČŠŽĐ.'])?$/i)
check('issuer_address', /^[a-zA-Z0-9ČŠŽĐ](?:[A-Z0-9 ČŠŽĐ\-.]{0,31}[A-Z0-9ČŠŽĐ])?$/i)
check('issuer_city', /^[a-zA-Z0-9ČŠŽĐ](?:[A-Z0-9 ČŠŽĐ]{0,31}[A-Z0-9ČŠŽĐ])?$/i)
// SET DEFAULT PURPOSE_CODE

View File

@@ -314,9 +314,9 @@ updateQR()
<h5 id="api-qrcode-issuer_name"><a href="#api-qrcode-issuer_name">&#128279;</a> <code>issuer_name</code></h5>
<div>
<span>Regex: <code>^[a-zA-Z0-9ČŠŽĐ.'](?:[A-Z0-9 ČŠŽĐ.']{0,31}[A-Z0-9ČŠŽĐ.'])?$/i</code></span>
<span>Regex: <code>^[a-zA-Z0-9ČŠŽĐ.'](?:[A-Z0-9 ČŠŽĐ.'\-]{0,31}[A-Z0-9ČŠŽĐ.'])?$/i</code></span>
<br>
<span>Demo: <a href="https://regex101.com/r/ubDgZL/1">regex101.com/r/ubDgZL/1</a></span>
<span>Demo: <a href="https://regex101.com/r/ND8T1c/1">regex101.com/r/ubDgZL/1</a></span>
<br>
<span>Description: Name and surname of the issuer or company name. Max length 33 characters including spaces and numbers.</span>
<br>
@@ -325,13 +325,13 @@ updateQR()
<h5 id="api-qrcode-issuer_address"><a href="#api-qrcode-issuer_address">&#128279;</a> <code>issuer_address</code></h5>
<div>
<span>Regex: <code>^[a-zA-Z0-9ČŠŽĐ](?:[A-Z0-9 ČŠŽĐ]{0,31}[A-Z0-9ČŠŽĐ])?$/i</code></span>
<span>Regex: <code>^[a-zA-Z0-9ČŠŽĐ](?:[A-Z0-9 ČŠŽĐ\-.]{0,31}[A-Z0-9ČŠŽĐ])?$/i</code></span>
<br>
<span>Demo: <a href="https://regex101.com/r/5oKk0T/1">regex101.com/r/5oKk0T/1</a></span>
<span>Demo: <a href="https://regex101.com/r/qgkRMO/1">regex101.com/r/5oKk0T/1</a></span>
<br>
<span>Description: Full issuer address in long form. Max length 33 characters including spaces and numbers.</span>
<span>Description: Full issuer address in long form. Max length 33 characters including spaces, numbers, minus and dot.</span>
<br>
<span>Example: Za deveto smreko 15 k</span>
<span>Example: Za deveto smreko 15-k p.p. 15</span>
</div>
<h5 id="api-qrcode-issuer_city"><a href="#api-qrcode-issuer_city">&#128279;</a> <code>issuer_city</code></h5>