[Backport] CXXCBC-829: Replace std::regex_search with utils::contains_string#955
Open
thejcfactor wants to merge 1 commit into
Open
[Backport] CXXCBC-829: Replace std::regex_search with utils::contains_string#955thejcfactor wants to merge 1 commit into
thejcfactor wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This backport introduces a lightweight substring helper (core::utils::contains_string) to replace several std::regex_search-based error-message pattern checks (notably around Query index error mapping), avoiding std::locale dependencies and reducing regex usage in core error handling.
Changes:
- Add
core::utils::contains_string(input, substr, ignore_case)with ASCII-only case folding. - Replace several
std::regex_searchchecks in query/management error handling withcontains_string(). - Add unit tests for
contains_string()and wire them into the test build.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
core/utils/contains_string.hxx |
Declares the new substring helper API. |
core/utils/contains_string.cxx |
Implements ASCII-only case-insensitive substring search. |
core/operations/document_query.cxx |
Replaces regex-based query error message checks with contains_string(). |
core/operations/management/error_utils.cxx |
Replaces regex-based query error translation checks with contains_string(). |
core/operations/management/query_index_create.cxx |
Replaces regex-based “index already exists” detection with contains_string(). |
core/operations/management/query_index_drop.cxx |
Replaces regex-based “index not found” detection with contains_string(). |
test/test_unit_contains_string.cxx |
Adds unit tests covering empty inputs, case sensitivity, ASCII-only folding, and query-pattern scenarios. |
test/CMakeLists.txt |
Registers the new contains_string unit test target. |
CMakeLists.txt |
Adds core/utils/contains_string.cxx to the library build sources. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4aefc9b to
1a09b12
Compare
avsej
reviewed
May 21, 2026
…_string Changes ------- * Add `contains_string(input, substr, ignore_case = false)` substirng match with optional ASCII-only case folding, no `std::locale` dependency * Replace remaining `std::regex_search` calls with utils::contains_string() * Add unit tests to confirm `contains_string()` functionality
1a09b12 to
ba81c78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
contains_string(input, substr, ignore_case = false)substirng match with optional ASCII-only case folding, nostd::localedependencystd::regex_searchcalls with utils::contains_string()contains_string()functionality