Regex To Match Strings After The Last Slash In A String
A regular expression that matches everything after the last slash in a string (like a URL or a file/folder path).
/[^/]+$/g
A regular expression that matches everything after the last slash in a string (like a URL or a file/folder path).
/[^/]+$/g
A regular expression to match a mailto link, without subject, cc, bcc, and body parameters.
/mailto:[a-zA-Z0-9_.+-][email protected][a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+/
A regular expression to match a YouTube Channel ID.
/https?:\/\/(www\.)?youtube.com\/channel\/UC([-_a-z0-9]{22})/i
A regular expression to match a ZIP archive file path.
/((\/|\\|\/\/|https?:\\\\|https?:\/\/)[a-z0-9\[email protected]\-^!#$%&+={}.\/\\\[\]]+)+\.zip$/i
A useful regex to match all URLs (with or without protocol) found in plain text.
/([\d\w-.]+?\.(a[cdefgilmnoqrstuwz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvxyz]|d[ejkmnoz]|e[ceghrst]|f[ijkmnor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eouw]|s[abcdeghijklmnortuvyz]|t[cdfghjkmnoprtvwz]|u[augkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw]|aero|arpa|biz|com|coop|edu|info|int|gov|mil|museum|name|net|org|pro)(\b|\W(?<!&|=)(?!\.\s|\.{3}).*?))(\s|$)/
A regular expression to check if is a valid folder name (no forbidden characters included).
/^[^\\\/\?\*\"\'\>\<\:\|]*$/
A Regular Expression that matches most domains including subdomains and IDN domain names.
/^((?!-))(xn--)?[a-z0-9][a-z0-9-_]{0,61}[a-z0-9]{0,1}\.(xn--)?([a-z0-9\-]{1,61}|[a-z0-9-]{1,30}\.[a-z]{2,})$/
A regular expression to parse and validate user-friendly URL slugs.
/^[a-z0-9]+(?:-[a-z0-9]+)*$/
A regular expression that matches all valid image links.
/^https?:\/\/(.+\/)+.+(\.(gif|png|jpg|jpeg|webp|svg|psd|bmp|tif))$/i
A regular expression to prase and validate public Vimeo Video Links (groups, players, channels are supported as well).
/(http|https)?:\/\/(www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|video\/|)(\d+)(?:|\/\?)/