Skip to content

Commit 322c90e

Browse files
committed
UK money validation added
1 parent c633080 commit 322c90e

File tree

5 files changed

+8
-1
lines changed

5 files changed

+8
-1
lines changed

src/main/java/com/seer/datacruncher/jpa/dao/ChecksTypeDao.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public class ChecksTypeDao {
4949
private static final String MONTHWORDS_IT_PATTERN = "(Gennaio|Febbraio|Marzo|Aprile|Maggio|Giugno|Luglio|Agosto|Settembre|Ottobre|Novembre|Dicembre)*"; //TODO: not case-sensitive
5050
private static final String NOHTML_PATTERN = "[^(<.+>)]*";
5151
private static final String ALPHABETIC_PATTERN = "[a-zA-Z\\s]*";
52+
private static final String POUND_STERLING = "£?(([1-9]{1,3}(,\\d{3})*(\\.\\d{2})?)|(0\\.[1-9]\\d)|(0\\.0[1-9]))";
5253

5354
/*** Matches following phone numbers:
5455
(123)456-7890, 123-456-7890, 1234567890, (123)-456-7890
@@ -262,7 +263,9 @@ public void init() {
262263
em.persist(checksTypeEntity);
263264
checksTypeEntity = new ChecksTypeEntity("@creditcard", "Finance -> Credit Card", "Generic credit card number", "Coded", true, null, null,"common.CreditCard");
264265
em.persist(checksTypeEntity);
265-
checksTypeEntity = new ChecksTypeEntity("@country", "Generic -> Country", "Country code, ISO 3166-1 alpha-2", "Coded", true, null, null,"common.ISOCountries");
266+
checksTypeEntity = new ChecksTypeEntity(null, "Finance -> Pound Sterling", "UK Money format", "Regular Expression", true, "regexps.pound_sterling", POUND_STERLING, null);
267+
em.persist(checksTypeEntity);
268+
checksTypeEntity = new ChecksTypeEntity("@country", "Generic -> Country", "Country code, ISO 3166-1 alpha-2", "Coded", true, null, null,"common.ISOCountries");
266269
em.persist(checksTypeEntity);
267270
checksTypeEntity = new ChecksTypeEntity("@domain", "Internet -> Domain name", "Internet domain name", "Coded", true, null, null,"common.Domain");
268271
em.persist(checksTypeEntity);

src/main/resources/locale/messages_de.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ regexps.month3chars_it=Month characters abbreviations Italian
140140
regexps.monthwords_it=Italian months
141141
regexps.monthwords_en=English months
142142
regexps.nohtml=No HTML allowed
143+
regexps.pound_sterling=UK Money format like £1,234.56
143144
regexps.alphabetic=Alphabetic characters allowed
144145

145146
#MONTH

src/main/resources/locale/messages_en.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ regexps.month3chars_it=Month characters abbreviations Italian
140140
regexps.monthwords_it=Italian months
141141
regexps.monthwords_en=English months
142142
regexps.nohtml=No HTML allowed
143+
regexps.pound_sterling=UK Money format like £1,234.56
143144
regexps.alphabetic=Alphabetic characters allowed
144145

145146
#MONTHS

src/main/resources/locale/messages_it.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ regexps.month3chars_it=Month characters abbreviations Italian
147147
regexps.monthwords_it=Italian months
148148
regexps.monthwords_en=English months
149149
regexps.nohtml=No HTML allowed
150+
regexps.pound_sterling=UK formato valuta tipo £1,234.56
150151
regexps.alphabetic=Alphabetic characters allowed
151152

152153
#MONTHS

src/main/resources/locale/messages_ru.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ regexps.month3chars_it=Month characters abbreviations Italian
140140
regexps.monthwords_it=Italian months
141141
regexps.monthwords_en=English months
142142
regexps.nohtml=No HTML allowed
143+
regexps.pound_sterling=UK Money format like £1,234.56
143144
regexps.alphabetic=Alphabetic characters allowed
144145

145146
#MONTHS

0 commit comments

Comments
 (0)