| [{ | [{ | ||||
| "name":"Date in format dd/mm/yyyy", | "name":"Date in format dd/mm/yyyy", | ||||
| "regex":"^(0?[1-9]|[12][0-9]|3[01])([ /\\\\-])(0?[1-9]|1[012])\\\\2([0-9][0-9][0-9][0-9])(([ -])([0-1]?[0-9]|2[0-3]):[0-5]?[0-9]:[0-5]?[0-9])?$", | |||||
| "regex":"(0?[1-9]|[12][0-9]|3[01])([ /-])(0?[1-9]|1[012])\\2([0-9][0-9][0-9][0-9])(([ -])([0-1]?[0-9]|2[0-3]):([0-5]?[0-9]):[0-5]?[0-9])?", | |||||
| "description":"Will match dates with dashes, slashes or with spaces (e.g. dd-mm-yyyy dd/mm/yyyy dd mm yyyy), and optional time separated by a space or a dash (e.g. dd-mm-yyyy-hh:mm:ss or dd/mm/yyyy hh:mm:ss).", | "description":"Will match dates with dashes, slashes or with spaces (e.g. dd-mm-yyyy dd/mm/yyyy dd mm yyyy), and optional time separated by a space or a dash (e.g. dd-mm-yyyy-hh:mm:ss or dd/mm/yyyy hh:mm:ss).", | ||||
| "tags":"date,time" | "tags":"date,time" | ||||
| }, | }, | ||||
| { | |||||
| "name":"Date in format mm/dd/yyyy", | |||||
| "regex":"(0?[1-9]|1[012])([ /-])(0?[1-9]|[12][0-9]|3[01])\\2([0-9][0-9][0-9][0-9])(([ -])([0-1]?[0-9]|2[0-3]):([0-5]?[0-9])(?::([0-5]?[0-9])))?", | |||||
| "description":"Will match dates with dashes, slashes or with spaces (e.g. mm-dd-yyyy mm/dd/yyyy mm dd yyyy), and optional time separated by a space or a dash (e.g. mm-dd-yyyy-hh:mm:ss or mm/dd/yyyy hh:mm:ss).", | |||||
| "tags":"date,time" | |||||
| }, | |||||
| { | { | ||||
| "name":"Time in 24-hour format", | "name":"Time in 24-hour format", | ||||
| "regex":"^([01]?[0-9]|2[0-3]):[0-5][0-9]$", | |||||
| "regex":"([01]?[0-9]|2[0-3]):([0-5][0-9]):?([0-5][0-9])?", | |||||
| "description": "Match times in 24 hour format", | "description": "Match times in 24 hour format", | ||||
| "tags":"date,time" | "tags":"date,time" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Date and time in ISO-8601 format", | "name":"Date and time in ISO-8601 format", | ||||
| "regex":"^(?![+-]?\\\\d{4,5}-?(?:\\\\d{2}|W\\\\d{2})T)(?:|(\\\\d{4}|[+-]\\\\d{5})-?(?:|(0\\\\d|1[0-2])(?:|-?([0-2]\\\\d|3[0-1]))|([0-2]\\\\d{2}|3[0-5]\\\\d|36[0-6])|W([0-4]\\\\d|5[0-3])(?:|-?([1-7])))(?:(?!\\\\d)|T(?=\\\\d)))(?:|([01]\\\\d|2[0-4])(?:|:?([0-5]\\\\d)(?:|:?([0-5]\\\\d)(?:|\\\\.(\\\\d{3})))(?:|[zZ]|([+-](?:[01]\\\\d|2[0-4]))(?:|:?([0-5]\\\\d)))))$", | |||||
| "description": "Will match a valid date and times in the ISO-8601 format, excludes durations.", | |||||
| "regex":"(?![+-]?\\d{4,5}-?(?:\\d{2}|W\\d{2})T)(?:|(\\d{4}|[+-]\\d{5})-?(?:|(0\\d|1[0-2])(?:|-?([0-2]\\d|3[0-1]))|([0-2]\\d{2}|3[0-5]\\d|36[0-6])|W([0-4]\\d|5[0-3])(?:|-?([1-7])))(?:(?!\\d)|T(?=\\d)))(?:|([01]\\d|2[0-4])(?:|:?([0-5]\\d)(?:|:?([0-5]\\d)(?:|\\.(\\d{3})))(?:|[zZ]|([+-](?:[01]\\d|2[0-4]))(?:|:?([0-5]\\d)))))", | |||||
| "description": "Will match a valid date and times in the ISO-8601 format, excludes durations. Requires perl style.", | |||||
| "tags": "date,time" | "tags": "date,time" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"HTML tags", | "name":"HTML tags", | ||||
| "regex":"^<([a-z1-6]+)([^<]+)*(?:>(.*)<\\\\/\\\\1>| *\\\\/>)$", | |||||
| "regex":"<([a-z1-6]+)([^<]+)*(?:>(.*)</\\1>| */>)", | |||||
| "description":"Match opening and closing HTML tags with content between", | "description":"Match opening and closing HTML tags with content between", | ||||
| "tags":"markup,xml,html" | "tags":"markup,xml,html" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Username", | "name":"Username", | ||||
| "regex":"^[a-zA-Z0-9_-]{3,16}$", | |||||
| "regex":"[a-zA-Z0-9_-]{3,16}", | |||||
| "description":"A string between 3 and 16 characters, allowing alphanumeric characters and hyphens and underscores", | "description":"A string between 3 and 16 characters, allowing alphanumeric characters and hyphens and underscores", | ||||
| "tags":"username,validation" | "tags":"username,validation" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Hex Color Value", | "name":"Hex Color Value", | ||||
| "regex":"^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$", | |||||
| "regex":"#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})\\b", | |||||
| "description":"RGB hex colors", | "description":"RGB hex colors", | ||||
| "tags":"hex,color" | "tags":"hex,color" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"URL Slug", | "name":"URL Slug", | ||||
| "regex":"^[a-z0-9-]+$", | |||||
| "regex":"[[:alnum:]-]+", | |||||
| "description":"Match valid URL slugs", | "description":"Match valid URL slugs", | ||||
| "tags":"URL" | "tags":"URL" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Email", | "name":"Email", | ||||
| "regex":"^.+@.+$", | |||||
| "description":"Verify that there is an @ symbol with something before it", | |||||
| "regex":"([[:alnum:]_.-]+)@([[:alnum:].-]+)\\.([[:alpha:].]{2,6})", | |||||
| "description":"Simple (but imperfect) email validation", | |||||
| "tags":"email,validation" | "tags":"email,validation" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"SRC of image tag", | "name":"SRC of image tag", | ||||
| "regex":"^<\\s*img[^>]+src\\s*=\\s*([\"'])(.*?)\\1[^>]*>$", | |||||
| "regex":"<\\s*img[^>]+src\\s*=\\s*([\"'])(.*?)\\1[^>]*>", | |||||
| "description":"Match the src attribute of an HTML image tag", | "description":"Match the src attribute of an HTML image tag", | ||||
| "tags":"html,tag,image" | "tags":"html,tag,image" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"URL", | "name":"URL", | ||||
| "regex":"^((https?|ftp|file):\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$", | |||||
| "regex":"((https?|ftp|file)://)?([[:alnum:].-]+)\\.([a-zA-Z.]{2,6})([/[[:alpha:].-]*)*/?", | |||||
| "description":"Match URL with optional protocol", | "description":"Match URL with optional protocol", | ||||
| "tags":"url,address,http" | "tags":"url,address,http" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"IPv4 Address", | "name":"IPv4 Address", | ||||
| "regex":"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$", | |||||
| "regex":"(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)", | |||||
| "description":"Match IP v4 addresses", | "description":"Match IP v4 addresses", | ||||
| "tags":"tcpip,internet,address" | "tags":"tcpip,internet,address" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"IPv6 Address", | "name":"IPv6 Address", | ||||
| "regex":"^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$", | |||||
| "regex":"(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))", | |||||
| "description": "Match IP v6 addresses", | "description": "Match IP v6 addresses", | ||||
| "tags":"tcpip,internet,address" | "tags":"tcpip,internet,address" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"JWT", | "name":"JWT", | ||||
| "regex":"^[A-Za-z0-9-_=]+\\.[A-Za-z0-9-_=]+\\.?[A-Za-z0-9-_.+/=]*$", | |||||
| "regex":"[A-Za-z0-9-_=]+\\.[A-Za-z0-9-_=]+\\.?[A-Za-z0-9-_.+/=]*", | |||||
| "description": "JSON Web Token (encoded)", | "description": "JSON Web Token (encoded)", | ||||
| "tags":"www" | "tags":"www" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Positive Integer", | "name":"Positive Integer", | ||||
| "regex":"^\\d+$", | |||||
| "regex":"\\d+", | |||||
| "description":"Match whole numbers above zero", | "description":"Match whole numbers above zero", | ||||
| "tags":"number" | "tags":"number" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Negative Integer", | "name":"Negative Integer", | ||||
| "regex":"^-\\d+$", | |||||
| "regex":"-\\d+", | |||||
| "description":"Match whole numbers below zero", | "description":"Match whole numbers below zero", | ||||
| "tags":"number" | "tags":"number" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Integer", | "name":"Integer", | ||||
| "regex":"^-?\\d+$", | |||||
| "regex":"-?\\d+", | |||||
| "description":"Match whole numbers, above or below zero", | "description":"Match whole numbers, above or below zero", | ||||
| "tags":"number" | "tags":"number" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Positive number", | "name":"Positive number", | ||||
| "regex":"^\\d*\\.?\\d+$", | |||||
| "regex":"\\d*\\.?\\d+", | |||||
| "description":"Match integers or floats that are positive", | "description":"Match integers or floats that are positive", | ||||
| "tags":"float" | "tags":"float" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Negative number", | "name":"Negative number", | ||||
| "regex":"^-\\d*\\.?\\d+$", | |||||
| "regex":"-\\d*\\.?\\d+", | |||||
| "description":"Match integers or floats that are negative", | "description":"Match integers or floats that are negative", | ||||
| "tags":"float" | "tags":"float" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Positive or negative number", | "name":"Positive or negative number", | ||||
| "regex":"^-?\\d*\\.?\\d+$", | |||||
| "regex":"-?\\d*\\.?\\d+", | |||||
| "description":"Match integers or floats that are positive or negative", | "description":"Match integers or floats that are positive or negative", | ||||
| "tags":"float" | "tags":"float" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Phone number", | |||||
| "regex":"^\\+?(\\d.*){3,}$", | |||||
| "name":"Phone number (general)", | |||||
| "regex":"\\+?(\\d.*){3,}", | |||||
| "description":"Match phone numbers at least 3 digits long", | "description":"Match phone numbers at least 3 digits long", | ||||
| "tags":"validation" | "tags":"validation" | ||||
| }, | }, | ||||
| { | |||||
| "name":"Phone number (US)", | |||||
| "regex":"(?:1)?[ .-]?(?:\\(?([2-9][0-9]{2})\\)?[ .-]?)?(?:(([2-9][0-9]{2})[ .-]?([0-9]{4}))|([0-9]{3}[ .-]?[0-9]{4}))", | |||||
| "description":"Match US phone number, with or without country or area code. Matches phone numbers like 1-800-234-5678 or 234-5679 or (555) 432-1234.", | |||||
| "tags":"validation" | |||||
| }, | |||||
| { | { | ||||
| "name":"New line", | "name":"New line", | ||||
| "regex":"[\\r\\n]|$", | |||||
| "regex":"[\\r\\n]", | |||||
| "description":"Match new lines within text", | "description":"Match new lines within text", | ||||
| "tags":"text" | "tags":"text" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"ID of Youtube video", | "name":"ID of Youtube video", | ||||
| "regex":"https?:\\/\\/(?:youtu\\.be\\/|(?:[a-z]{2,3}\\.)?youtube\\.com\\/watch(?:\\?|#\\!)v=)([\\w-]{11}).*/gi", | |||||
| "regex":"https?://(?:youtu\\.be/|(?:[a-z]{2,3}\\.)?youtube\\.com/watch(?:\\?|#!)v=)([[:alnum:]-]{11}).*", | |||||
| "description":"Match the ID of a youtube video URL", | "description":"Match the ID of a youtube video URL", | ||||
| "tags":"video,youtube,url" | "tags":"video,youtube,url" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"ID of Youtube Channel", | "name":"ID of Youtube Channel", | ||||
| "regex":"https?:\\/\\/(www\\.)?youtube.com\\/channel\\/UC([-_a-z0-9]{22})/i", | |||||
| "regex":"https?://(www\\.)?youtube.com/channel/UC([-_a-z0-9]{22})/i", | |||||
| "description":"Match the ID of a youtube channel URL", | "description":"Match the ID of a youtube channel URL", | ||||
| "tags":"channel,youtube,url" | "tags":"channel,youtube,url" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"CSS comment", | "name":"CSS comment", | ||||
| "regex":"\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\/", | |||||
| "regex":"/\\*[^*]*\\*+([^/*][^*]*\\*+)*/", | |||||
| "description":"Match standard CSS comments", | "description":"Match standard CSS comments", | ||||
| "tags":"css,comment,code" | "tags":"css,comment,code" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Wordpress shortcodes", | "name":"Wordpress shortcodes", | ||||
| "regex":"^\\[([a-z-_0-9]+)([^\\[]+)*(?:\\](.*)\\[\\/\\1\\]|\\s+\\/\\])$", | |||||
| "regex":"\\[([a-z-_0-9]+)([^\\[]+)*(?:\\](.*)\\[/\\1\\]|\\s+/\\])", | |||||
| "description":"Matches opening and closing shortcode tags with content in-between them.", | "description":"Matches opening and closing shortcode tags with content in-between them.", | ||||
| "tags":"wordpress,shortcodes,markup" | "tags":"wordpress,shortcodes,markup" | ||||
| }, | }, | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"UK Postal Code", | "name":"UK Postal Code", | ||||
| "regex":"^(([gG][iI][rR] {0,}0[aA]{2})|(([aA][sS][cC][nN]|[sS][tT][hH][lL]|[tT][dD][cC][uU]|[bB][bB][nN][dD]|[bB][iI][qQ][qQ]|[fF][iI][qQ][qQ]|[pP][cC][rR][nN]|[sS][iI][qQ][qQ]|[iT][kK][cC][aA]) {0,}1[zZ]{2})|((([a-pr-uwyzA-PR-UWYZ][a-hk-yxA-HK-XY]?[0-9][0-9]?)|(([a-pr-uwyzA-PR-UWYZ][0-9][a-hjkstuwA-HJKSTUW])|([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y][0-9][abehmnprv-yABEHMNPRV-Y]))) {0,}[0-9][abd-hjlnp-uw-zABD-HJLNP-UW-Z]{2}))$", | |||||
| "regex":"(([gG][iI][rR] {0,}0[aA]{2})|(([aA][sS][cC][nN]|[sS][tT][hH][lL]|[tT][dD][cC][uU]|[bB][bB][nN][dD]|[bB][iI][qQ][qQ]|[fF][iI][qQ][qQ]|[pP][cC][rR][nN]|[sS][iI][qQ][qQ]|[iT][kK][cC][aA]) {0,}1[zZ]{2})|((([a-pr-uwyzA-PR-UWYZ][a-hk-yxA-HK-XY]?[0-9][0-9]?)|(([a-pr-uwyzA-PR-UWYZ][0-9][a-hjkstuwA-HJKSTUW])|([a-pr-uwyzA-PR-UWYZ][a-hk-yA-HK-Y][0-9][abehmnprv-yABEHMNPRV-Y]))) {0,}[0-9][abd-hjlnp-uw-zABD-HJLNP-UW-Z]{2}))", | |||||
| "description":"Matches all UK postcodes", | "description":"Matches all UK postcodes", | ||||
| "tags":"address, postal, zip" | "tags":"address, postal, zip" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Brazilian ZIP/Postal Code", | "name":"Brazilian ZIP/Postal Code", | ||||
| "regex":"^[0-9]{5}-[0-9]{3}$", | |||||
| "regex":"[0-9]{5}-[0-9]{3}", | |||||
| "description":"Matches BR ZIP/Postal Code", | "description":"Matches BR ZIP/Postal Code", | ||||
| "tags":"address, postal, zip" | "tags":"address, postal, zip" | ||||
| }, | }, | ||||
| { | { | ||||
| "name":"Morse Code", | "name":"Morse Code", | ||||
| "regex":"^[.-]{1,5}(?:[ \\t]+[.-]{1,5})*(?:[ \\t]+[.-]{1,5}(?:[ \\t]+[.-]{1,5})*)*$", | |||||
| "regex":"[.-]{1,5}(?:[ \\t]+[.-]{1,5})*(?:[ \\t]+[.-]{1,5}(?:[ \\t]+[.-]{1,5})*)*", | |||||
| "description":"Matches valid Morse Code", | "description":"Matches valid Morse Code", | ||||
| "tags":"morse, code" | "tags":"morse, code" | ||||
| }, | }, |