<commit_before>const defaultConfig = require('./default-config')
const generateLabel = require('./generate-label')

/**
 * Returns the regex, labels and config object used in every handler
 * @param {object} context - Probot context object
 * @returns {object}
 */
module.exports = async context => {
  const config = await context.config('config.yml')
  const cfg = config && config.todo ? {...defaultConfig, ...config.todo} : defaultConfig
  const labels = await generateLabel(context, cfg)
  const keywords = Array.isArray(cfg.keyword) ? cfg.keyword : [cfg.keyword]
  const reg = new RegExp(`^diff --git a/.+ b/(.+)[\\s\\S]+?^@{2}.+\\+(\\d+).+@{2}([\\s\\S]+?(^(\\+).*(${keywords.join('|')})(?:[:-\\s]+)?\\s(.*))[\\s\\S]+)`, 'gm')

  return {
    config: cfg,
    regex: reg,
    labels
  }
}<commit_msg>Escape things in the RegEx<commit_after>const defaultConfig = require('./default-config')
const generateLabel = require('./generate-label')

/**
 * Returns the regex, labels and config object used in every handler
 * @param {object} context - Probot context object
 * @returns {object}
 */
module.exports = async context => {
  const config = await context.config('config.yml')
  const cfg = config && config.todo ? {...defaultConfig, ...config.todo} : defaultConfig
  const labels = await generateLabel(context, cfg)
  const keywords = Array.isArray(cfg.keyword) ? cfg.keyword : [cfg.keyword]
  const reg = new RegExp(`^diff --git a\\/.+ b\\/(.+)[\\s\\S]+?^@{2}.+\\+(\\d+).+@{2}([\\s\\S]+?(^(\\+).*(${keywords.join('|')})(?:[:-\\s]+)?\\s(.*))[\\s\\S]+)`, 'gm')

  return {
    config: cfg,
    regex: reg,
    labels
  }
}
{'fraction_non_alphanumeric': 0.23204419889502761, 'fraction_numerical': 0.0024554941682013503, 'mean_word_length': 3.515235457063712, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4523511', 'n_tokens_mistral': 545, 'n_tokens_neox': 535, 'n_words': 130}