Skip to content

fix(Segments): Standardise regex matching in the PHP server-side SDK - #152

Open
linear-code[bot] wants to merge 1 commit into
mainfrom
linear/sdk-27-standardise-regex-matching-in-the-php-server-side-sdk-b3d9
Open

linear-code[bot] wants to merge 1 commit into
mainfrom
linear/sdk-27-standardise-regex-matching-in-the-php-server-side-sdk-b3d9

Conversation

@linear-code

@linear-code linear-code Bot commented Nov 3, 2026

Copy link
Copy Markdown

Local evaluation accepted a regex match anywhere in a trait value, so prod put nonproduction in a segment. The documented behaviour is that a match must start at the beginning of the value but doesn't need to cover all of it. This applies to every alternative, so prod|dev matches development but not nondev.

Changes

  • Regex segment conditions match only from the start of the trait value, with no full-match requirement. The pattern isn't rewritten; PCRE's anchored (A) modifier is used instead.
  • Added regression cases for prefix, mid-string, alternation, end-anchored, documented examples and case-sensitive matching

Closes https://linear.app/flagsmith/issue/SDK-27/standardise-regex-matching-in-the-php-server-side-sdk

Review effort: 1/5

Regex segment conditions now match from the start of the trait value,
for every alternative, without requiring a full-string match.

Generated with [Linear](https://linear.app/flagsmith/agent-session/a271d061-9f7c-4f8a-a88b-9225fe6e9d66)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
@linear-code
linear-code Bot requested a review from a team as a code owner November 3, 2026 15:45
@linear-code
linear-code Bot requested review from khvn26 and removed request for a team November 3, 2026 15:45
@linear-code

linear-code Bot commented Nov 3, 2026

Copy link
Copy Markdown
Author

SDK-27

@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 1596c69b-f1da-4435-bb8b-503a8a48d9e5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@linear-code

linear-code Bot commented Nov 3, 2026

Copy link
Copy Markdown
Author

@coderabbitai review

@codspeed

codspeed Bot commented Nov 3, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 15 untouched benchmarks


Comparing linear/sdk-27-standardise-regex-matching-in-the-php-server-side-sdk-b3d9 (4e7c8f1) with main (a0d835d)

Open in CodSpeed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants