Skip to content

Comments

Treat ~* as operator#173

Merged
greg0ire merged 2 commits intodoctrine:1.5.xfrom
vrana:pgsql-regexp
Feb 8, 2026
Merged

Treat ~* as operator#173
greg0ire merged 2 commits intodoctrine:1.5.xfrom
vrana:pgsql-regexp

Conversation

@vrana
Copy link
Contributor

@vrana vrana commented Feb 6, 2026

Also fix regular expression escaping

@greg0ire
Copy link
Member

greg0ire commented Feb 7, 2026

Also fix regular expression escaping

If you find yourself using "also" in a commit message, it probably means you should have 2 commits. What was wrong with the escaping, and how did you fix it?

@vrana
Copy link
Contributor Author

vrana commented Feb 7, 2026

Sure.

@greg0ire
Copy link
Member

greg0ire commented Feb 7, 2026

What was wrong with the escaping, and how did you fix it?

@vrana
Copy link
Contributor Author

vrana commented Feb 7, 2026

/ was unnecessarily escaped even though the delimiter was ~. Using delimiter ~ required escaping it in $boundaries and elsewhere even though these are preg_quote'd later. Using () as the delimiter allows treating all characters the same.

@greg0ire
Copy link
Member

greg0ire commented Feb 7, 2026

Please include that explanation in your commit message.

@greg0ire
Copy link
Member

greg0ire commented Feb 7, 2026

@mvorisek please review.

}

$regex .= preg_quote($prefix, '/');
$regex .= preg_quote($prefix);
Copy link
Contributor

@mvorisek mvorisek Feb 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR LGTM and I like this change, it seem / was even wrong here as later ~ delimtier was used.

@greg0ire
Copy link
Member

greg0ire commented Feb 8, 2026

@vrana please improve your commit message according to the contributing guide.

Specifically, please wrap the body of your commit message at 72 chars.

vrana added 2 commits February 8, 2026 11:27
`/` was unnecessarily escaped even though the delimiter was `~`.
Using delimiter `~` required escaping it in `$boundaries` and elsewhere
even though these are `preg_quote`'d later.
Using `()` as the delimiter allows treating all characters the same.
@greg0ire greg0ire added this to the 1.5.4 milestone Feb 8, 2026
@greg0ire greg0ire merged commit 9563949 into doctrine:1.5.x Feb 8, 2026
10 checks passed
@greg0ire
Copy link
Member

greg0ire commented Feb 8, 2026

Thanks @vrana !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants