Skip to main content
Version: Next

๐Ÿชˆ RegExp

Collection of RegExp patterns (26 items).

Import
import { IsConfig } from 'thiis';

bigintโ€‹

RegExp
/^([-+])?(\d+)n/
Example
// Regular
IsConfig.regExp.bigint.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.bigint));

wordโ€‹

RegExp
/^[a-zA-Z]+$/
Example
// Regular
IsConfig.regExp.word.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.word));

ipv6โ€‹

RegExp
/^((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?$/
Example
// Regular
IsConfig.regExp.ipv6.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.ipv6));

ipv4โ€‹

RegExp
/^((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]?)$/
Example
// Regular
IsConfig.regExp.ipv4.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.ipv4));

macAddressโ€‹

RegExp
/^(?:[0-9A-Fa-f]{2}[:-]){5}(?:[0-9A-Fa-f]{2})$/
Example
// Regular
IsConfig.regExp.macAddress.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.macAddress));

pascalCaseโ€‹

RegExp
/^[A-Z][a-z0-9]*([A-Z][a-z0-9]*)*$/
Example
// Regular
IsConfig.regExp.pascalCase.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.pascalCase));

kebabCaseโ€‹

RegExp
/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/
Example
// Regular
IsConfig.regExp.kebabCase.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.kebabCase));

camelCaseโ€‹

RegExp
/^[a-z][a-zA-Z0-9]*([A-Z][a-zA-Z0-9]*)*$/
Example
// Regular
IsConfig.regExp.camelCase.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.camelCase));

snakeCaseโ€‹

RegExp
/^(?!^[0-9]+$)[a-z0-9]+(_[a-z0-9]+)*$/
Example
// Regular
IsConfig.regExp.snakeCase.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.snakeCase));

lowerCaseโ€‹

RegExp
/[a-z]/
Example
// Regular
IsConfig.regExp.lowerCase.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.lowerCase));

upperCaseโ€‹

RegExp
/[A-Z]/
Example
// Regular
IsConfig.regExp.upperCase.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.upperCase));

safariโ€‹

RegExp
/^((?!chrome|android).)*safari/i
Example
// Regular
IsConfig.regExp.safari.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.safari));

firefoxโ€‹

RegExp
/firefox|fxios/i
Example
// Regular
IsConfig.regExp.firefox.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.firefox));

androidโ€‹

RegExp
/android/i
Example
// Regular
IsConfig.regExp.android.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.android));

windowsโ€‹

RegExp
/windows|^win/i
Example
// Regular
IsConfig.regExp.windows.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.windows));

operaโ€‹

RegExp
/OPR|Opera/i
Example
// Regular
IsConfig.regExp.opera.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.opera));

iphoneโ€‹

RegExp
/(iPhone)/i
Example
// Regular
IsConfig.regExp.iphone.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.iphone));

ipadโ€‹

RegExp
/(iPad)/i
Example
// Regular
IsConfig.regExp.ipad.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.ipad));

ipodโ€‹

RegExp
/(iPod)/i
Example
// Regular
IsConfig.regExp.ipod.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.ipod));

ieโ€‹

RegExp
/(Trident\/|MSIE\s)([\d.]+)/
Example
// Regular
IsConfig.regExp.ie.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.ie));

edgeโ€‹

RegExp
/edge|edg|edga\/(\d+)/i
Example
// Regular
IsConfig.regExp.edge.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.edge));

macโ€‹

RegExp
/mac/i
Example
// Regular
IsConfig.regExp.mac.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.mac));

chromeโ€‹

RegExp
/Chrome|CriOS/i
Example
// Regular
IsConfig.regExp.chrome.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.chrome));

googleIncโ€‹

RegExp
/Google Inc/i
Example
// Regular
IsConfig.regExp.googleInc.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.googleInc));

phoneโ€‹

RegExp
/phone/i
Example
// Regular
IsConfig.regExp.phone.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.phone));

blackberryโ€‹

RegExp
/blackberry|bb10/i
Example
// Regular
IsConfig.regExp.blackberry.text($yourData) // Boolean

// Angular Validators.pattern
const control = new Control('', Validators.pattern(IsConfig.regExp.blackberry));