Skip to content

Add initial implementation of regex_utils library containing a regex to wildcard string translator and a corresponding std::error_code enum and category.#482

Merged
Bill-hbrhbr merged 11 commits intoy-scope:mainfrom
Bill-hbrhbr:regex-utils-error-code
Jul 19, 2024

Conversation

@Bill-hbrhbr
Copy link
Copy Markdown
Contributor

Description

For wildcard queries that are disguised as regex queries, perform a best-effort translation so that CLP can turn such queries into more efficient searches.

Current translation functionalities include:

  1. Turn . into ?
  2. .* into *
  3. .+ into ?*

A std::error_code wrapper has been implemented for failed translations so that the translation functions have result<T,E> return style.

Validation performed

Verified in unit tests.

davidlion
davidlion previously approved these changes Jul 19, 2024
Copy link
Copy Markdown
Member

@davidlion davidlion left a comment

Choose a reason for hiding this comment

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

Add an initial implementation of the regex_utils library, containing a regex to wildcard string translator and a corresponding std::error_code enum and category.

@davidlion davidlion changed the title Implement most basic regex translation utils and error codes. Add an initial implementation of the regex_utils library, containing a regex to wildcard string translator and a corresponding std::error_code enum and category. Jul 19, 2024
Bill-hbrhbr and others added 2 commits July 19, 2024 03:16
Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com>
LinZhihao-723
LinZhihao-723 previously approved these changes Jul 19, 2024
@davidlion davidlion changed the title Add an initial implementation of the regex_utils library, containing a regex to wildcard string translator and a corresponding std::error_code enum and category. Add initial implementation of regex_utils library containing a regex to wildcard string translator and a corresponding std::error_code enum and category. Jul 19, 2024
@Bill-hbrhbr Bill-hbrhbr merged commit 44aaff9 into y-scope:main Jul 19, 2024
@Bill-hbrhbr Bill-hbrhbr deleted the regex-utils-error-code branch July 19, 2024 08:07
jackluo923 pushed a commit to jackluo923/clp that referenced this pull request Dec 4, 2024
…to wildcard string translator and a corresponding std::error_code enum and category. (y-scope#482)

Co-authored-by: Bingran Hu <bingran.hu@yscope.com>
Co-authored-by: davidlion <david.lion@yscope.com>
Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com>
Co-authored-by: Kirk Rodrigues <2454684+kirkrodrigues@users.noreply.github.com>
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.

4 participants