commit 23c017d81adeb8229a04f4a7f19bd082a061c0ad
parent fb2d30b8dd66458ca5c0d05529d390a9dc8b8404
Author: triesap <137732411+triesap@users.noreply.github.com>
Date: Sat, 26 Oct 2024 19:08:52 +0000
utils: add/edit regex
Diffstat:
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/utils/src/regex.ts b/utils/src/regex.ts
@@ -1,6 +1,7 @@
export const regex: Record<string, RegExp> = {
word_only: /^[a-zA-Z]+$/,
alpha: /[a-zA-Z ]$/,
+ alpha_ch: /[a-zA-Z ]$/,
num: /^[0-9]+$/,
alphanum: /[a-zA-Z0-9., ]$/,
alphanum_ch: /[a-zA-Z0-9., ]/,
@@ -8,4 +9,5 @@ export const regex: Record<string, RegExp> = {
price_ch: /[0-9.]$/,
profile_name: /^[a-zA-Z0-9._]{3,30}$/,
profile_name_ch: /[a-zA-Z0-9._]/,
+ trade_product_key: /^(?:[a-zA-Z0-9]+(?:\s+[a-zA-Z0-9]+){0,2})?$/,
};
diff --git a/utils/src/types.ts b/utils/src/types.ts
@@ -8,7 +8,7 @@ export type ResultPass = { pass: true; };
export type ResultsList<T> = { results: T[]; };
export type ResultObj<T> = { result: T; };
-export type FieldRecord = Record<string,string>;
+export type FieldRecord = Record<string, string>;
export type LocationPoint = GeolocationCoordinatesPoint & {
lat: number;