Skip to content

Commit cf164f0

Browse files
Match regex rule with data-models
1 parent c75201c commit cf164f0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/pages/GiftAid/utils/Utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ export const getPathParams = (update = false) => {
5151
};
5252
};
5353

54+
// Regex matches what we use in data-models, which the backend uses to validate postcodes.
5455
export const postcodeRegex = {
5556
GB: {
56-
pattern: '^[a-z]{1,2}\\d[a-z\\d]?\\s*\\d[a-z]{2}$',
57+
pattern: '^[A-Za-z]{1,2}\\d[A-Za-z\\d]?\\s*\\d[A-Za-z]{2}$',
5758
errorMsg: 'Please enter a valid UK postcode, using a space. For non-UK addresses, please use manual entry below.',
5859
},
5960
};

0 commit comments

Comments
 (0)