CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-escape-string-regexp

Escape RegExp special characters in strings for safe use in regular expressions

100

1.00x
Quality

Pending

Does it follow best practices?

Impact

100%

1.00x

Average score across 7 eval scenarios

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

criteria.jsonevals/scenario-1/

{
  "context": "This criteria evaluates how well an engineer uses the escape-string-regexp package to safely escape special characters for regex usage, particularly focusing on character class and mid-pattern insertion safety with proper hyphen handling.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Uses escape-string-regexp",
      "description": "The solution imports and uses the escape-string-regexp package (or escapeStringRegexp function) to escape special regex characters",
      "max_score": 25
    },
    {
      "name": "Escapes in findLiteralPattern",
      "description": "The findLiteralPattern function correctly uses escapeStringRegexp to escape the search term before constructing a regex pattern",
      "max_score": 20
    },
    {
      "name": "Constructs valid regex",
      "description": "The solution correctly constructs a RegExp object using the escaped string and uses it to test against the target text",
      "max_score": 15
    },
    {
      "name": "Handles Unicode correctly",
      "description": "The solution properly handles Unicode characters including emojis, ensuring they are preserved during escaping and matching",
      "max_score": 10
    },
    {
      "name": "Escapes in buildCharacterClassPattern",
      "description": "The buildCharacterClassPattern function uses escapeStringRegexp to escape each pattern string in the array",
      "max_score": 15
    },
    {
      "name": "Handles hyphen escaping",
      "description": "The solution recognizes that escapeStringRegexp uses \\x2d for hyphens, which ensures safety in character class contexts by preventing unintended range creation",
      "max_score": 15
    }
  ]
}

tile.json