Skip to content

Commit 3417a4f

Browse files
authored
Merge pull request #2405 from IntersectMBO/feat/support-ipfs-in-govtool-frontend-service
feat: extend IPFS url regex
2 parents 96e7472 + b108010 commit 3417a4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

govtool/frontend/src/utils/isValidFormat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
import i18n from "@/i18n";
66

77
export const URL_REGEX =
8-
/^(?:(?:https?:\/\/)?(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})(?:\/[^\s]*)?)|(?:ipfs:\/\/[a-f0-9]+(?:\/[a-zA-Z0-9_]+)*)$|^$/;
8+
/^(?:(?:https?:\/\/)?(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})(?:\/[^\s]*)?)|(?:ipfs:\/\/(?:[a-zA-Z0-9]+(?:\/[a-zA-Z0-9._-]+)*))$|^$/;
99
export const HASH_REGEX = /^[0-9A-Fa-f]+$/;
1010
export const PAYMENT_ADDRESS_REGEX = /addr1[a-z0-9]+/i;
1111

0 commit comments

Comments
 (0)