Expected Behavior
When I add a regex special character to an exclusion word I don't want to deal with the problem of regex-escaping them because is really confusing to add escaping characters to YAML. Additionally, the documentation of the action is not referrencing that exclusion words are regexes, it refers to them as "keywords".
Current Behavior
When I add a regex special character to an exclusion, the action raises a Syntax error. I can reproduce it locally with, for example:
> 'icon\nrequest\n[\n]'.split(/[\s\n]+/).map((keyword) => keyword.trim()).filter((keyword) => keyword.length > 0).reduce((memo, keyword) => memo.replace(new RegExp(keyword, 'igm'), ''), '[icon request] hello world')
Uncaught SyntaxError: Invalid regular expression: /[/: Unterminated character class
Possible Solution
Regex-escaping exclude keywords with a function like this:
function escapeRegExp(text) {
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
Other solution would be to define exclude keywords as regexes in the documentation and provide an example of regex-escaping them.
Expected Behavior
When I add a regex special character to an exclusion word I don't want to deal with the problem of regex-escaping them because is really confusing to add escaping characters to YAML. Additionally, the documentation of the action is not referrencing that exclusion words are regexes, it refers to them as "keywords".
Current Behavior
When I add a regex special character to an exclusion, the action raises a Syntax error. I can reproduce it locally with, for example:
Possible Solution
Regex-escaping
excludekeywords with a function like this:Other solution would be to define
excludekeywords as regexes in the documentation and provide an example of regex-escaping them.