<commit_before>package cucumberexpressions

import (
	"errors"
	"regexp"
)

var HAS_FLAG_REGEKP = regexp.MustCompile(`\(\?[imsU-]+(\:.*)?\)`)
var UNESCAPE_REGEXP = regexp.MustCompile(`(\\([\[$.|?*+\]]))`)
var ILLEGAL_PARAMETER_NAME_REGEXP = regexp.MustCompile(`([\[\]()$.|?*+])`)

type ParameterType struct {
	name                 string
	regexps              []*regexp.Regexp
	type1                string // Cannot have a field named type as hit a compile error
	transform            func(...*string) interface{}
	useForSnippets       bool
	preferForRegexpMatch bool
}

func CheckParameterTypeName(typeName string) (error) {
	if ILLEGAL_PARAMETER_NAME_REGEXP.MatchString(typeName) {
		return errors.New("Illegal character '[' in parameter name {[string]}")
	}<commit_msg>Remove hard coding<commit_after>package cucumberexpressions

import (
	"errors"
	"regexp"
	"fmt"
)

var HAS_FLAG_REGEKP = regexp.MustCompile(`\(\?[imsU-]+(\:.*)?\)`)
var UNESCAPE_REGEXP = regexp.MustCompile(`(\\([\[$.|?*+\]]))`)
var ILLEGAL_PARAMETER_NAME_REGEXP = regexp.MustCompile(`([\[\]()$.|?*+])`)

type ParameterType struct {
	name                 string
	regexps              []*regexp.Regexp
	type1                string // Cannot have a field named type as hit a compile error
	transform            func(...*string) interface{}
	useForSnippets       bool
	preferForRegexpMatch bool
}

func CheckParameterTypeName(typeName string) (error) {
	unescapedTypeName := UNESCAPE_REGEXP.ReplaceAllString(typeName, "$2");
	if ILLEGAL_PARAMETER_NAME_REGEXP.MatchString(typeName) {
		c := ILLEGAL_PARAMETER_NAME_REGEXP.FindStringSubmatch(typeName)[0]
		return errors.New(fmt.Sprintf("Illegal character '%s' in parameter name {%s}", c, unescapedTypeName))
	}
{'fraction_non_alphanumeric': 0.14765489287782282, 'fraction_numerical': 0.0023161551823972205, 'mean_word_length': 3.8813559322033897, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7576857', 'n_tokens_mistral': 612, 'n_tokens_neox': 580, 'n_words': 121}