simplified regex

This commit is contained in:
Shashankh Kanni
2023-10-11 18:46:03 +05:30
parent d2c689fd10
commit 24bee149fa
+1 -1
View File
@@ -18,7 +18,7 @@
let element: HTMLInputElement;
let error: string;
const pattern = String.raw`/^(\*|\?|[0-5]?\d)(\,(\*|\?|[0-5]?\d)|\-(\*|\?|[0-5]?\d)|\/\d+)?\s+(\*|\?|[01]?\d|2[0-3])(\,(\*|\?|[01]?\d|2[0-3])|\-(\*|\?|[01]?\d|2[0-3])|\/\d+)?\s+(\*|\?|[1-9]|[12]\d|3[01])(W?)(\,(\*|\?|[1-9]|[12]\d|3[01])|\-(\*|\?|[1-9]|[12]\d|3[01])|\/\d+)?\s+(\*|\?|[1-9]|1[0-2]|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(\,(\*|\?|[1-9]|1[0-2]|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)|\-(\*|\?|[1-9]|1[0-2]|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)|\/\d+)?\s+(\*|\?|[0-7]((\#?)(\d?))(\w?)|sun|mon|tue|wed|thu|fri|sat)(\,(\*|\?|[0-7]((\#?)(\d?))(\w?)|sun|mon|tue|wed|thu|fri|sat)|\-(\*|\?|[0-7]((\#?)(\d?))(\w?)|sun|mon|tue|wed|thu|fri|sat)|\/\d((\#?)(\d?))(\w?)+)?$/i`;
const pattern = String.raw`^.*\s+.*\s+.*\s+.*\s+.*`;
onMount(() => {
if (element && autofocus) {
element.focus();