Skip to content

Instantly share code, notes, and snippets.

@connorjclark
Created February 1, 2019 18:48
Show Gist options
  • Save connorjclark/ddd773fa4de4b7e6f32a4256fb08714b to your computer and use it in GitHub Desktop.
Save connorjclark/ddd773fa4de4b7e6f32a4256fb08714b to your computer and use it in GitHub Desktop.
super poly regex
/(^
| |
)|(Array\.?from\s*=|Array\[['"]from['"]\]\s*=|defineProperty\(Array,\s*['"]from['"]|;e\([^,]*,['"]Array['"],{from)|(Array\.?isArray\s*=|Array\[['"]isArray['"]\]\s*=|defineProperty\(Array,\s*['"]isArray['"]|;e\([^,]*,['"]Array['"],{isArray)|(Array\.?of\s*=|Array\[['"]of['"]\]\s*=|defineProperty\(Array,\s*['"]of['"]|;e\([^,]*,['"]Array['"],{of)|(Array.prototype\.?copyWithin\s*=|Array.prototype\[['"]copyWithin['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]copyWithin['"]|;e\([^,]*,['"]Array['"],{copyWithin)|(Array.prototype\.?fill\s*=|Array.prototype\[['"]fill['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]fill['"]|;e\([^,]*,['"]Array['"],{fill)|(Array.prototype\.?filter\s*=|Array.prototype\[['"]filter['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]filter['"]|;e\([^,]*,['"]Array['"],{filter)|(Array.prototype\.?find\s*=|Array.prototype\[['"]find['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]find['"]|;e\([^,]*,['"]Array['"],{find)|(Array.prototype\.?findIndex\s*=|Array.prototype\[['"]findIndex['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]findIndex['"]|;e\([^,]*,['"]Array['"],{findIndex)|(Array.prototype\.?forEach\s*=|Array.prototype\[['"]forEach['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]forEach['"]|;e\([^,]*,['"]Array['"],{forEach)|(Array.prototype\.?includes\s*=|Array.prototype\[['"]includes['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]includes['"]|;e\([^,]*,['"]Array['"],{includes)|(Array.prototype\.?indexOf\s*=|Array.prototype\[['"]indexOf['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]indexOf['"]|;e\([^,]*,['"]Array['"],{indexOf)|(Array.prototype\.?join\s*=|Array.prototype\[['"]join['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]join['"]|;e\([^,]*,['"]Array['"],{join)|(Array.prototype\.?lastIndexOf\s*=|Array.prototype\[['"]lastIndexOf['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]lastIndexOf['"]|;e\([^,]*,['"]Array['"],{lastIndexOf)|(Array.prototype\.?slice\s*=|Array.prototype\[['"]slice['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]slice['"]|;e\([^,]*,['"]Array['"],{slice)|(Array.prototype\.?some\s*=|Array.prototype\[['"]some['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]some['"]|;e\([^,]*,['"]Array['"],{some)|(Array.prototype\.?sort\s*=|Array.prototype\[['"]sort['"]\]\s*=|defineProperty\(Array.prototype,\s*['"]sort['"]|;e\([^,]*,['"]Array['"],{sort)|(\.?CustomEvent\s*=|\[['"]CustomEvent['"]\]\s*=|defineProperty\(['"]window['"],\s*['"]CustomEvent['"])|(Date\.?now\s*=|Date\[['"]now['"]\]\s*=|defineProperty\(Date,\s*['"]now['"]|;e\([^,]*,['"]Date['"],{now)|(Date.prototype\.?toISOString\s*=|Date.prototype\[['"]toISOString['"]\]\s*=|defineProperty\(Date.prototype,\s*['"]toISOString['"]|;e\([^,]*,['"]Date['"],{toISOString)|(Date.prototype\.?toJSON\s*=|Date.prototype\[['"]toJSON['"]\]\s*=|defineProperty\(Date.prototype,\s*['"]toJSON['"]|;e\([^,]*,['"]Date['"],{toJSON)|(Element.prototype\.?classList\s*=|Element.prototype\[['"]classList['"]\]\s*=|defineProperty\(Element.prototype,\s*['"]classList['"]|;e\([^,]*,['"]Element['"],{classList)|(Element.prototype\.?closest\s*=|Element.prototype\[['"]closest['"]\]\s*=|defineProperty\(Element.prototype,\s*['"]closest['"]|;e\([^,]*,['"]Element['"],{closest)|(Element.prototype\.?matches\s*=|Element.prototype\[['"]matches['"]\]\s*=|defineProperty\(Element.prototype,\s*['"]matches['"]|;e\([^,]*,['"]Element['"],{matches)|(Element.prototype\.?toggleAttribute\s*=|Element.prototype\[['"]toggleAttribute['"]\]\s*=|defineProperty\(Element.prototype,\s*['"]toggleAttribute['"]|;e\([^,]*,['"]Element['"],{toggleAttribute)|(Function.prototype\.?bind\s*=|Function.prototype\[['"]bind['"]\]\s*=|defineProperty\(Function.prototype,\s*['"]bind['"]|;e\([^,]*,['"]Function['"],{bind)|(HTMLCanvasElement.prototype\.?toBlob\s*=|HTMLCanvasElement.prototype\[['"]toBlob['"]\]\s*=|defineProperty\(HTMLCanvasElement.prototype,\s*['"]toBlob['"]|;e\([^,]*,['"]HTMLCanvasElement['"],{toBlob)|(Math\.?acosh\s*=|Math\[['"]acosh['"]\]\s*=|defineProperty\(Math,\s*['"]acosh['"]|;e\([^,]*,['"]Math['"],{acosh)|(Math\.?asinh\s*=|Math\[['"]asinh['"]\]\s*=|defineProperty\(Math,\s*['"]asinh['"]|;e\([^,]*,['"]Math['"],{asinh)|(Math\.?atanh\s*=|Math\[['"]atanh['"]\]\s*=|defineProperty\(Math,\s*['"]atanh['"]|;e\([^,]*,['"]Math['"],{atanh)|(Math\.?cbrt\s*=|Math\[['"]cbrt['"]\]\s*=|defineProperty\(Math,\s*['"]cbrt['"]|;e\([^,]*,['"]Math['"],{cbrt)|(Math\.?cosh\s*=|Math\[['"]cosh['"]\]\s*=|defineProperty\(Math,\s*['"]cosh['"]|;e\([^,]*,['"]Math['"],{cosh)|(Math\.?fround\s*=|Math\[['"]fround['"]\]\s*=|defineProperty\(Math,\s*['"]fround['"]|;e\([^,]*,['"]Math['"],{fround)|(Math\.?hypot\s*=|Math\[['"]hypot['"]\]\s*=|defineProperty\(Math,\s*['"]hypot['"]|;e\([^,]*,['"]Math['"],{hypot)|(Math\.?sign\s*=|Math\[['"]sign['"]\]\s*=|defineProperty\(Math,\s*['"]sign['"]|;e\([^,]*,['"]Math['"],{sign)|(Math\.?sinh\s*=|Math\[['"]sinh['"]\]\s*=|defineProperty\(Math,\s*['"]sinh['"]|;e\([^,]*,['"]Math['"],{sinh)|(Math\.?tanh\s*=|Math\[['"]tanh['"]\]\s*=|defineProperty\(Math,\s*['"]tanh['"]|;e\([^,]*,['"]Math['"],{tanh)|(Math\.?trunc\s*=|Math\[['"]trunc['"]\]\s*=|defineProperty\(Math,\s*['"]trunc['"]|;e\([^,]*,['"]Math['"],{trunc)|(\.?MouseEvent\s*=|\[['"]MouseEvent['"]\]\s*=|defineProperty\(['"]window['"],\s*['"]MouseEvent['"])|(Node.prototype\.?after\s*=|Node.prototype\[['"]after['"]\]\s*=|defineProperty\(Node.prototype,\s*['"]after['"]|;e\([^,]*,['"]Node['"],{after)|(Node.prototype\.?append\s*=|Node.prototype\[['"]append['"]\]\s*=|defineProperty\(Node.prototype,\s*['"]append['"]|;e\([^,]*,['"]Node['"],{append)|(Node.prototype\.?before\s*=|Node.prototype\[['"]before['"]\]\s*=|defineProperty\(Node.prototype,\s*['"]before['"]|;e\([^,]*,['"]Node['"],{before)|(Node.prototype\.?children\s*=|Node.prototype\[['"]children['"]\]\s*=|defineProperty\(Node.prototype,\s*['"]children['"]|;e\([^,]*,['"]Node['"],{children)|(Node.prototype\.?prepend\s*=|Node.prototype\[['"]prepend['"]\]\s*=|defineProperty\(Node.prototype,\s*['"]prepend['"]|;e\([^,]*,['"]Node['"],{prepend)|(Node.prototype\.?remove\s*=|Node.prototype\[['"]remove['"]\]\s*=|defineProperty\(Node.prototype,\s*['"]remove['"]|;e\([^,]*,['"]Node['"],{remove)|(Node.prototype\.?replaceWith\s*=|Node.prototype\[['"]replaceWith['"]\]\s*=|defineProperty\(Node.prototype,\s*['"]replaceWith['"]|;e\([^,]*,['"]Node['"],{replaceWith)|(NodeList.prototype\.?forEach\s*=|NodeList.prototype\[['"]forEach['"]\]\s*=|defineProperty\(NodeList.prototype,\s*['"]forEach['"]|;e\([^,]*,['"]NodeList['"],{forEach)|(Number\.?EPSILON\s*=|Number\[['"]EPSILON['"]\]\s*=|defineProperty\(Number,\s*['"]EPSILON['"]|;e\([^,]*,['"]Number['"],{EPSILON)|(Number\.?isFinite\s*=|Number\[['"]isFinite['"]\]\s*=|defineProperty\(Number,\s*['"]isFinite['"]|;e\([^,]*,['"]Number['"],{isFinite)|(Number\.?isInteger\s*=|Number\[['"]isInteger['"]\]\s*=|defineProperty\(Number,\s*['"]isInteger['"]|;e\([^,]*,['"]Number['"],{isInteger)|(Number\.?isNaN\s*=|Number\[['"]isNaN['"]\]\s*=|defineProperty\(Number,\s*['"]isNaN['"]|;e\([^,]*,['"]Number['"],{isNaN)|(Number\.?isSafeInteger\s*=|Number\[['"]isSafeInteger['"]\]\s*=|defineProperty\(Number,\s*['"]isSafeInteger['"]|;e\([^,]*,['"]Number['"],{isSafeInteger)|(Number\.?parseFloat\s*=|Number\[['"]parseFloat['"]\]\s*=|defineProperty\(Number,\s*['"]parseFloat['"]|;e\([^,]*,['"]Number['"],{parseFloat)|(Number\.?parseInt\s*=|Number\[['"]parseInt['"]\]\s*=|defineProperty\(Number,\s*['"]parseInt['"]|;e\([^,]*,['"]Number['"],{parseInt)|(Number.prototype\.?toFixed\s*=|Number.prototype\[['"]toFixed['"]\]\s*=|defineProperty\(Number.prototype,\s*['"]toFixed['"]|;e\([^,]*,['"]Number['"],{toFixed)|(Object\.?assign\s*=|Object\[['"]assign['"]\]\s*=|defineProperty\(Object,\s*['"]assign['"]|;e\([^,]*,['"]Object['"],{assign)|(Object\.?create\s*=|Object\[['"]create['"]\]\s*=|defineProperty\(Object,\s*['"]create['"]|;e\([^,]*,['"]Object['"],{create)|(Object\.?defineProperties\s*=|Object\[['"]defineProperties['"]\]\s*=|defineProperty\(Object,\s*['"]defineProperties['"]|;e\([^,]*,['"]Object['"],{defineProperties)|(Object\.?defineProperty\s*=|Object\[['"]defineProperty['"]\]\s*=|defineProperty\(Object,\s*['"]defineProperty['"]|;e\([^,]*,['"]Object['"],{defineProperty)|(Object\.?entries\s*=|Object\[['"]entries['"]\]\s*=|defineProperty\(Object,\s*['"]entries['"]|;e\([^,]*,['"]Object['"],{entries)|(Object\.?getOwnPropertyDescriptors\s*=|Object\[['"]getOwnPropertyDescriptors['"]\]\s*=|defineProperty\(Object,\s*['"]getOwnPropertyDescriptors['"]|;e\([^,]*,['"]Object['"],{getOwnPropertyDescriptors)|(Object\.?is\s*=|Object\[['"]is['"]\]\s*=|defineProperty\(Object,\s*['"]is['"]|;e\([^,]*,['"]Object['"],{is)|(Object\.?setPrototypeOf\s*=|Object\[['"]setPrototypeOf['"]\]\s*=|defineProperty\(Object,\s*['"]setPrototypeOf['"]|;e\([^,]*,['"]Object['"],{setPrototypeOf)|(Object\.?values\s*=|Object\[['"]values['"]\]\s*=|defineProperty\(Object,\s*['"]values['"]|;e\([^,]*,['"]Object['"],{values)|(Promise.prototype\.?finally\s*=|Promise.prototype\[['"]finally['"]\]\s*=|defineProperty\(Promise.prototype,\s*['"]finally['"]|;e\([^,]*,['"]Promise['"],{finally)|(Reflect\.?apply\s*=|Reflect\[['"]apply['"]\]\s*=|defineProperty\(Reflect,\s*['"]apply['"]|;e\([^,]*,['"]Reflect['"],{apply)|(Reflect\.?construct\s*=|Reflect\[['"]construct['"]\]\s*=|defineProperty\(Reflect,\s*['"]construct['"]|;e\([^,]*,['"]Reflect['"],{construct)|(Reflect\.?deleteProperty\s*=|Reflect\[['"]deleteProperty['"]\]\s*=|defineProperty\(Reflect,\s*['"]deleteProperty['"]|;e\([^,]*,['"]Reflect['"],{deleteProperty)|(Reflect\.?getPrototypeOf\s*=|Reflect\[['"]getPrototypeOf['"]\]\s*=|defineProperty\(Reflect,\s*['"]getPrototypeOf['"]|;e\([^,]*,['"]Reflect['"],{getPrototypeOf)|(Reflect\.?has\s*=|Reflect\[['"]has['"]\]\s*=|defineProperty\(Reflect,\s*['"]has['"]|;e\([^,]*,['"]Reflect['"],{has)|(Reflect\.?isExtensible\s*=|Reflect\[['"]isExtensible['"]\]\s*=|defineProperty\(Reflect,\s*['"]isExtensible['"]|;e\([^,]*,['"]Reflect['"],{isExtensible)|(Reflect\.?ownKeys\s*=|Reflect\[['"]ownKeys['"]\]\s*=|defineProperty\(Reflect,\s*['"]ownKeys['"]|;e\([^,]*,['"]Reflect['"],{ownKeys)|(Reflect\.?preventExtensions\s*=|Reflect\[['"]preventExtensions['"]\]\s*=|defineProperty\(Reflect,\s*['"]preventExtensions['"]|;e\([^,]*,['"]Reflect['"],{preventExtensions)|(String\.?fromCodePoint\s*=|String\[['"]fromCodePoint['"]\]\s*=|defineProperty\(String,\s*['"]fromCodePoint['"]|;e\([^,]*,['"]String['"],{fromCodePoint)|(String.prototype\.?codePointAt\s*=|String.prototype\[['"]codePointAt['"]\]\s*=|defineProperty\(String.prototype,\s*['"]codePointAt['"]|;e\([^,]*,['"]String['"],{codePointAt)|(String.prototype\.?endsWith\s*=|String.prototype\[['"]endsWith['"]\]\s*=|defineProperty\(String.prototype,\s*['"]endsWith['"]|;e\([^,]*,['"]String['"],{endsWith)|(String.prototype\.?includes\s*=|String.prototype\[['"]includes['"]\]\s*=|defineProperty\(String.prototype,\s*['"]includes['"]|;e\([^,]*,['"]String['"],{includes)|(String.prototype\.?padEnd\s*=|String.prototype\[['"]padEnd['"]\]\s*=|defineProperty\(String.prototype,\s*['"]padEnd['"]|;e\([^,]*,['"]String['"],{padEnd)|(String.prototype\.?padStart\s*=|String.prototype\[['"]padStart['"]\]\s*=|defineProperty\(String.prototype,\s*['"]padStart['"]|;e\([^,]*,['"]String['"],{padStart)|(String.prototype\.?repeat\s*=|String.prototype\[['"]repeat['"]\]\s*=|defineProperty\(String.prototype,\s*['"]repeat['"]|;e\([^,]*,['"]String['"],{repeat)|(String.prototype\.?startsWith\s*=|String.prototype\[['"]startsWith['"]\]\s*=|defineProperty\(String.prototype,\s*['"]startsWith['"]|;e\([^,]*,['"]String['"],{startsWith)|(String.prototype\.?trim\s*=|String.prototype\[['"]trim['"]\]\s*=|defineProperty\(String.prototype,\s*['"]trim['"]|;e\([^,]*,['"]String['"],{trim)|(String\.?raw\s*=|String\[['"]raw['"]\]\s*=|defineProperty\(String,\s*['"]raw['"]|;e\([^,]*,['"]String['"],{raw)/g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment