<commit_before>/* eslint no-eval: 0 */

const MATH_REGEXP = /^[-+/*\d\s\( )]+$/;

/**
 * Plugin to show result of math calculation
 * @param  {String} term
 */
const mathPlugin = (term, callback) => {
  const match = term.match(MATH_REGEXP);
  if (match) {
    try {
      const result = eval(term);
      callback({
        title: `= ${result}`,
        icon: '/Applications/Calculator.app',
        term: `${term} = ${result}`,
        clipboard: result,
      });
    } catch (err) {<commit_msg>Fix regexp for math plugin<commit_after>/* eslint no-eval: 0 */

const MATH_REGEXP = /^[-+/*\d\s,\.\( )]+$/;

/**
 * Plugin to show result of math calculation
 * @param  {String} term
 */
const mathPlugin = (term, callback) => {
  const match = term.match(MATH_REGEXP);
  if (match) {
    try {
      const result = eval(term.replace(',', '.'));
      callback({
        title: `= ${result}`,
        icon: '/Applications/Calculator.app',
        term: `${term} = ${result}`,
        clipboard: result,
      });
    } catch (err) {
{'fraction_non_alphanumeric': 0.19514563106796118, 'fraction_numerical': 0.001941747572815534, 'mean_word_length': 2.459731543624161, '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': '1957130', 'n_tokens_mistral': 358, 'n_tokens_neox': 348, 'n_words': 88}