code: function hasPrefix(text, prefix) {
    let exp = new RegExp(`^${prefix.pattern}`);
    let result = exp.test(text);
  
    if (prefix.antipattern) {
      let exp = new RegExp(`^${prefix.antipattern}`);
      result = result && !exp.test(text);
    }
  
    return result;
  }
docs: Check if given prefix is present.
  @private