Improve regexes #32

Merged
verbiricha merged 3 commits from improve-regex into main 2023-01-11 22:05:49 +00:00
Showing only changes of commit 425a21b095 - Show all commits

View File

@ -61,9 +61,9 @@ export const InvoiceRegex = /(lnbc\w+)/i;
/** /**
* YouTube URL regex * YouTube URL regex
*/ */
export const YoutubeUrlRegex = /^(?:https?:\/\/)?(?:www|m\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/ export const YoutubeUrlRegex = /(?:https?:\/\/)?(?:www|m\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})/;
/** /**
* Hashtag regex * Hashtag regex
*/ */
export const HashtagRegex = /(#[^\s!@#$%^&*()=+.\/,\[{\]};:'"?><]+)/ export const HashtagRegex = /(#[^\s!@#$%^&*()=+.\/,\[{\]};:'"?><]+)/;