[XS] Change in code/re2[main]: python: fix re2.search(compiled, text)

2 views
Skip to first unread message

Russ Cox (Gerrit)

unread,
Aug 4, 2025, 5:53:40 PMAug 4
to Alan Donovan, re2...@googlegroups.com
Attention needed from Alan Donovan

Russ Cox has uploaded the change for review

Russ Cox would like Alan Donovan to review this change.

Commit message

python: fix re2.search(compiled, text)

The old code was accidentally recompiling the pattern
and losing the options, both inefficient and incorrect.
Thanks to @MajorTanya for the excellent diagnosis.

This bug was introduced in CL 60290 and then copied
over from the Abseil branch.

Fixes #558.
Change-Id: I072707003b444fb0934a310e14147b4d65b9da11

Change information

Files:
  • M python/re2.py
  • M python/re2_test.py
Change size: XS
Delta: 2 files changed, 7 insertions(+), 1 deletion(-)
Open in Gerrit

Related details

Attention is currently required from:
  • Alan Donovan
Submit Requirements:
  • requirement is blockingCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: re2
Gerrit-Branch: main
Gerrit-Change-Id: I072707003b444fb0934a310e14147b4d65b9da11
Gerrit-Change-Number: 63830
Gerrit-PatchSet: 1
Gerrit-Owner: Russ Cox <r...@swtch.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Attention: Alan Donovan <adon...@google.com>
blocking_requirement
unsatisfied_requirement
open
diffy

Alan Donovan (Gerrit)

unread,
Aug 4, 2025, 6:06:08 PMAug 4
to Russ Cox, re2...@googlegroups.com
Attention needed from Russ Cox

Alan Donovan voted and added 1 comment

Votes added by Alan Donovan

Code-Review+2

1 comment

Commit Message
Line 9, Patchset 1 (Latest):The old code was accidentally recompiling the pattern

and losing the options, both inefficient and incorrect.
Thanks to @MajorTanya for the excellent diagnosis.
Alan Donovan . resolved

Funny, this is a weirdly parallel bug to https://jpcamara.com/2025/08/02/the-o-in-ruby-regex.html, which I happened to read about this week.

Open in Gerrit

Related details

Attention is currently required from:
  • Russ Cox
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: re2
Gerrit-Branch: main
Gerrit-Change-Id: I072707003b444fb0934a310e14147b4d65b9da11
Gerrit-Change-Number: 63830
Gerrit-PatchSet: 1
Gerrit-Owner: Russ Cox <r...@swtch.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Attention: Russ Cox <r...@swtch.com>
Gerrit-Comment-Date: Mon, 04 Aug 2025 22:06:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Russ Cox (Gerrit)

unread,
Aug 4, 2025, 7:11:03 PMAug 4
to Alan Donovan, re2...@googlegroups.com

Russ Cox submitted the change

Change information

Commit message:
python: fix re2.search(compiled, text)

The old code was accidentally recompiling the pattern
and losing the options, both inefficient and incorrect.
Thanks to @MajorTanya for the excellent diagnosis.

This bug was introduced in CL 60290 and then copied
over from the Abseil branch.

Fixes #558.
Change-Id: I072707003b444fb0934a310e14147b4d65b9da11
Reviewed-by: Alan Donovan <adon...@google.com>
Files:
  • M python/re2.py
  • M python/re2_test.py
Change size: XS
Delta: 2 files changed, 7 insertions(+), 1 deletion(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Alan Donovan
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: re2
Gerrit-Branch: main
Gerrit-Change-Id: I072707003b444fb0934a310e14147b4d65b9da11
Gerrit-Change-Number: 63830
Gerrit-PatchSet: 2
Gerrit-Owner: Russ Cox <r...@swtch.com>
Gerrit-Reviewer: Alan Donovan <adon...@google.com>
Gerrit-Reviewer: Russ Cox <r...@swtch.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages