PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: DmitrySoshnikov/regexp-tree (js)

Issue:
`/\e/u` should throw
`/\e/u` is an invalid regular expression: https://mathiasbynens.be/notes/es6-unicode-regex#impact-syntax

So instead of parsing, I’d expect this to throw:

```
$ regexp-tree -e '/\e/u'
{
  "type": "RegExp",
  "body": {
    "type": "Char",
    "value": "e",
    "kind": "simple",
    "escaped": true
  },
  "flags": [
    "u"
  ]
}
```


Pull request:
Parser: When u flag is set, throw error on invalid unicode escape
This should fix #8 

Patch:
diff --git a/src/parser/generated/regexp-tree.js b/src/parser/generated/regexp-tree.js
index 8ddf1a3..29fd404 100644
--- a/src/parser/generated/regexp-tree.js
+++ b/src/parser/generated/regexp-tree.js
@@ -360,7 +360,13 @@ const lexRules = [[/^#[^\n]+/, function() { /* skip comments */ }],
 [/^\\x[0-9a-fA-F]{2}/, function() { return 'HEX_CODE' }],
 [/^\\[tnrdDsSwWvf]/, function() { return 'META_CHAR' }],
 [/^\\\//, function() { return 'ESC_CHAR' }],
-[/^\\[^*?+\[()]/, function() { return 'ESC_CHAR' }],
+[/^\\[^*?+\[()]/, function() { 
+                                        const s = this.getCurrentState();
+                                        if (s === 'u' || s === 'xu' || s === 'u_class') {
+                                            throw new SyntaxError(`invalid Unicode escape ${yytext}`);
+                                        }
+                                        return 'ESC_CHAR';
+                                     }],
 [/^\\[*?+\[()]/, function() { return 'ESC_CHAR' }],
 [/^\(/, function() { return 'CHAR' }],
 [/^\)/, function() { return 'CHAR' }],
diff --git a/src/parser/regexp.bnf b/src/parser/regexp.bnf
index 89b8b2c..133cf3b 100644
--- a/src/parser/regexp.bnf
+++ b/src/parser/regexp.bnf
@@ -103,7 +103,14 @@ GROUP_NAME              ([\w$]|\\'u'[0-9a-fA-F]{4}|\\'u{'[0-9a-fA-F]{1,}'}')+
 
 {ESC}'/'                            return 'ESC_CHAR'
 
-{ESC}{CHAR}                         return 'ESC_CHAR'
+{ESC}{CHAR}                         {
+                                        const s = this.getCurrentState();
+                                        if (s === 'u' || s === 'xu' || s === 'u_class') {
+                                            throw new SyntaxError(`invalid Unicode escape ${yytext}`);
+                                        }
+                                        return 'ESC_CHAR';
+                                    }
+
 {ESC}[*?+\[()]                      return 'ESC_CHAR'
 
 <class,u_class>'('                  return 'CHAR'


Test patch:
diff --git a/src/parser/__tests__/parser-basic-test.js b/src/parser/__tests__/parser-basic-test.js
index 4a4b4e1..32733a5 100644
--- a/src/parser/__tests__/parser-basic-test.js
+++ b/src/parser/__tests__/parser-basic-test.js
@@ -1068,4 +1068,10 @@ describe('basic', () => {
     });
   });
 
+  it('throws error on invalid Unicode escape', () => {
+    expect(() => parser.parse('/\\p/u')).toThrowError(SyntaxError);
+    expect(() => parser.parse('/\\e/u')).toThrowError(SyntaxError);
+    expect(() => parser.parse('/\\g/u')).toThrowError(SyntaxError);
+  });
+
 });
\ No newline at end of file
Repository: nukosuke/go-zendesk (go)

Issue:
No Redaction support
We would like to use this api for ticket comment redaction: https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/#redact-ticket-comment-in-agent-workspace


Pull request:
Add ticket comment redaction
Fixes #259 

Patch:
diff --git a/fixture/PUT/redact_ticket_comment.json b/fixture/PUT/redact_ticket_comment.json
new file mode 100644
index 0000000..bea4970
--- /dev/null
+++ b/fixture/PUT/redact_ticket_comment.json
@@ -0,0 +1,10 @@
+{
+  "comment": {
+    "attachments": [],
+    "author_id": 123,
+    "id": 123,
+    "plain_body": "My ID number is ▇▇▇▇!",
+    "public": true,
+    "type": "Comment"
+  }
+}
diff --git a/zendesk/ticket_comment.go b/zendesk/ticket_comment.go
index e1c14b2..59e9ea9 100644
--- a/zendesk/ticket_comment.go
+++ b/zendesk/ticket_comment.go
@@ -33,6 +33,13 @@ type TicketComment struct {
 	Via *Via `json:"via,omitempty"`
 }
 
+// RedactTicketCommentRequest contains the body of the RedactTicketComment PUT request
+type RedactTicketCommentRequest struct {
+	TicketID               int64    `json:"ticket_id"` // Required
+	HTMLBody               string   `json:"html_body,omitempty"`
+	ExternalAttachmentUrls []string `json:"external_attachment_urls,omitempty"`
+}
+
 // NewPublicTicketComment generates and returns a new TicketComment
 func NewPublicTicketComment(body string, authorID int64) TicketComment {
 	public := true
@@ -111,3 +118,16 @@ func (z *Client) MakeCommentPrivate(ctx context.Context, ticketID int64, ticketC
 	_, err := z.put(ctx, path, nil)
 	return err
 }
+
+// RedactTicketComment permanently removes words, strings, or attachments from a ticket comment
+//
+// ref: https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/#redact-ticket-comment-in-agent-workspace
+func (z *Client) RedactTicketComment(
+	ctx context.Context,
+	ticketCommentID int64,
+	body RedactTicketCommentRequest,
+) error {
+	path := fmt.Sprintf("/api/v2/comment_redactions/%d.json", ticketCommentID)
+	_, err := z.put(ctx, path, body)
+	return err
+}


Test patch:
diff --git a/zendesk/ticket_comment_test.go b/zendesk/ticket_comment_test.go
index 731cef0..8943297 100644
--- a/zendesk/ticket_comment_test.go
+++ b/zendesk/ticket_comment_test.go
@@ -100,3 +100,18 @@ func TestMakeCommentPrivate(t *testing.T) {
 		})
 	}
 }
+
+func TestRedactTicketComment(t *testing.T) {
+	mockAPI := newMockAPI(http.MethodPut, "redact_ticket_comment.json")
+	client := newTestClient(mockAPI)
+	defer mockAPI.Close()
+
+	err := client.RedactTicketComment(ctx, 123, RedactTicketCommentRequest{
+		TicketID: 100,
+		HTMLBody: "<div class=\"zd-comment\" dir=\"auto\">My ID number is <redact>847564</redact>!</div>",
+	})
+
+	if err != nil {
+		t.Fatalf("Failed to redact ticket comment: %s", err)
+	}
+}