constructor(capacity) {
    this.capacity = capacity;
    this.regExpMap = new Map();
    // Since our capacity tends to be fairly small, `.shift()` will be fairly quick despite being O(n). We just use a
    // normal array to keep it simple.
    this.regExpQueue = [];
  }
This is a reusable regular expression cache class. Given a certain maximum number of regular expressions we're
allowed to store in the cache, it provides a way to avoid recreating regular expression objects over and over.
When it needs to evict something, it evicts the oldest one.