This post situates regular expressions or “regex” within the computer science context of regular grammar and finite automata.
Many entities in a JS runtime environment can turn out to be
undefined. According to ES specs, “Any variable that has not been assigned a value has the value
undefined.” It strikes me as conceptually inconsistent to tack onto the above that any variable that has been assigned a value can also have the value
undefined to signify the absence of any value.
Minimizing lookup times is a central problem in data management, particularly for large applications. Linear lookup time is bad. Sublinear lookup time is better. Constant lookup is ideal.