Skip to content

Treat ~* as operator#173

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

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

Conversation

@vrana

@vrana vrana commented Feb 6, 2026

Copy link
Copy Markdown
Contributor

Also fix regular expression escaping

@greg0ire

greg0ire commented Feb 7, 2026

Copy link
Copy Markdown
Member

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

vrana commented Feb 7, 2026

Copy link
Copy Markdown
Contributor Author

Sure.

@greg0ire

greg0ire commented Feb 7, 2026

Copy link
Copy Markdown
Member

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

@vrana

vrana commented Feb 7, 2026

Copy link
Copy Markdown
Contributor Author

/ 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 commented Feb 7, 2026

Copy link
Copy Markdown
Member

Please include that explanation in your commit message.

@greg0ire

greg0ire commented Feb 7, 2026

Copy link
Copy Markdown
Member

@mvorisek please review.

Comment thread src/Tokenizer.php
}

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

@mvorisek mvorisek Feb 8, 2026

Copy link
Copy Markdown
Contributor

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

greg0ire commented Feb 8, 2026

Copy link
Copy Markdown
Member

@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

greg0ire commented Feb 8, 2026

Copy link
Copy Markdown
Member

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