Skip to content

Commit

Permalink
Refactor URL regex pattern in regex.js
Browse files Browse the repository at this point in the history
  • Loading branch information
totallynotdavid committed Mar 20, 2024
1 parent 1936a53 commit 3e8f126
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions/regex.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Used when converting external media to stickers. GIFs are not supported because they are not animated stickers
const urlRegex =
/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.%]+(\.(jpg|jpeg|gifv|png|mp4))$/;
/^(?:https?:\/\/)?[\w.-]+(?:\.[\w]+\b)+\/[\w\-._~:/?#[\]@!$&'()*+,;=.%]*(\.(jpg|jpeg|gifv|png|mp4))$/;
const imageOrVideoRegex = /\.(jpg|jpeg|gifv|png|mp4)$/i;
const websiteAllowedRegex =
/^https?:\/\/(?:www\.)?reddit\.com\/r\/[\w-]+\/comments\/[\w-]+\/[\w-]+\/?$/i;
Expand Down

0 comments on commit 3e8f126

Please sign in to comment.