Skip to content

match_regex_with_checksum operator: match and verify regexes with a checksum#450

Merged
Anilm3 merged 7 commits into
masterfrom
anilm3/regex-checksum
Sep 18, 2025
Merged

match_regex_with_checksum operator: match and verify regexes with a checksum#450
Anilm3 merged 7 commits into
masterfrom
anilm3/regex-checksum

Conversation

@Anilm3

@Anilm3 Anilm3 commented Sep 10, 2025

Copy link
Copy Markdown
Collaborator

This PR introduces a new operator with the goal of being able to match identifiers which can be validated with a checksum. The operator is called match_regex_with_checksum, as the regex is used to extract the identifier and the checksum to validate that the identifier matches a known criteria. For example, this operator may be used to determine if a pattern resembling a credit card is indeed a credit card.

The operator requires the same parameters as a regex, in addition to a checksum algorithm which has to be specified by name. In this PR, a simple version of the luhn check digit algorithm has been implemented.

@codecov-commenter

codecov-commenter commented Sep 10, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.23%. Comparing base (03f7484) to head (e59cc64).
⚠️ Report is 30 commits behind head on master.

Files with missing lines Patch % Lines
src/matcher/regex_match_with_checksum.cpp 91.66% 1 Missing and 1 partial ⚠️
src/matcher/regex_match.cpp 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #450      +/-   ##
==========================================
+ Coverage   85.14%   85.23%   +0.09%     
==========================================
  Files         180      186       +6     
  Lines        9289     9347      +58     
  Branches     4115     4138      +23     
==========================================
+ Hits         7909     7967      +58     
  Misses        551      551              
  Partials      829      829              
Flag Coverage Δ
waf_test 85.23% <95.65%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Sep 10, 2025

Copy link
Copy Markdown

Artifact Size Comparison 📦

Artifact Previous Release This PR Difference
darwin-arm64::libddwaf.a 89560336 89863936 0.00%
darwin-arm64::libddwaf.a.stripped 4545616 4570736 0.00%
darwin-arm64::libddwaf.dylib 1960784 1963024 0.00%
darwin-universal::libddwaf.a 180532808 181145200 0.00%
darwin-universal::libddwaf.a.stripped 9690824 9743768 0.00%
darwin-universal::libddwaf.dylib 4139856 4142096 0.00%
darwin-x86_64::libddwaf.a 90972424 91281216 0.00%
darwin-x86_64::libddwaf.a.stripped 5145160 5172984 0.00%
darwin-x86_64::libddwaf.dylib 2147776 2150888 0.00%
linux-aarch64::libddwaf.a 72647358 73024804 0.00%
linux-aarch64::libddwaf.a.stripped 11778162 11827136 0.00%
linux-aarch64::libddwaf.so 2453368 2457520 0.00%
linux-armv7::libddwaf.a 64279684 64592594 0.00%
linux-armv7::libddwaf.a.stripped 10783356 10826670 0.00%
linux-armv7::libddwaf.so 2138996 2142652 0.00%
linux-i386::libddwaf.a 62427430 62722222 0.00%
linux-i386::libddwaf.a.stripped 9321362 9358698 0.00%
linux-i386::libddwaf.so 2382908 2386948 0.00%
linux-x86_64::libddwaf.a 73129494 73506156 0.00%
linux-x86_64::libddwaf.a.stripped 11599138 11645840 0.00%
linux-x86_64::libddwaf.so 2649632 2654128 0.00%
windows-arm64::ddwaf.dll 4769280 4779008 0.00%
windows-arm64::ddwaf.lib 11698 11698 0.00%
windows-arm64::ddwaf_static.lib 57431616 57794512 0.00%
windows-win32::ddwaf.dll 3356160 3361792 0.00%
windows-win32::ddwaf.lib 11922 11922 0.00%
windows-win32::ddwaf_static.lib 49113786 49442278 0.00%
windows-x64::ddwaf.dll 4088832 4094976 0.00%
windows-x64::ddwaf.lib 11698 11698 0.00%
windows-x64::ddwaf_static.lib 56948354 57312036 0.00%
windows-x86_64::libddwaf.a 6464848 6516132 0.00%
windows-x86_64::libddwaf.dll 18860246 18875018 0.00%
windows-x86_64::libddwaf.dll.a 31948 31948 0.00%

@Anilm3
Anilm3 force-pushed the anilm3/regex-checksum branch from 829178f to ec17221 Compare September 10, 2025 20:02
@Anilm3

Anilm3 commented Sep 10, 2025

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment thread src/matcher/regex_match.cpp
@pr-commenter

pr-commenter Bot commented Sep 10, 2025

Copy link
Copy Markdown

Benchmarks clang

Benchmark execution time: 2025-09-17 16:28:28

Comparing candidate commit 59b454a in PR branch anilm3/regex-checksum with baseline commit 03f7484 in branch master.

Found 0 performance improvements and 1 performance regressions! Performance is the same for 0 metrics, 0 unstable metrics.

scenario:global-benchmark.random.clang

  • 🟥 execution_time [+39.057ms; +39.072ms] or [+15.892%; +15.898%]

@pr-commenter

pr-commenter Bot commented Sep 11, 2025

Copy link
Copy Markdown

Benchmarks gcc

Benchmark execution time: 2025-09-18 14:52:36

Comparing candidate commit e59cc64 in PR branch anilm3/regex-checksum with baseline commit 03f7484 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@pr-commenter

pr-commenter Bot commented Sep 11, 2025

Copy link
Copy Markdown

Benchmarks clang-pgo

Benchmark execution time: 2025-09-12 15:39:21

Comparing candidate commit 368ff3b in PR branch anilm3/regex-checksum with baseline commit 03f7484 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@Anilm3
Anilm3 force-pushed the anilm3/regex-checksum branch from 5ca1053 to 09381f6 Compare September 11, 2025 10:05
@Anilm3
Anilm3 force-pushed the anilm3/regex-checksum branch from 09381f6 to 2603ae0 Compare September 11, 2025 10:09
@Anilm3

Anilm3 commented Sep 11, 2025

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment thread src/matcher/regex_match_with_checksum.cpp Outdated
@Anilm3
Anilm3 force-pushed the anilm3/regex-checksum branch from b4458c6 to 68e4663 Compare September 11, 2025 15:46
@Anilm3 Anilm3 changed the title Support checksum on regex_match New operator match_regex_with_checksum to match and verify regexes with a checksum Sep 11, 2025
@Anilm3 Anilm3 changed the title New operator match_regex_with_checksum to match and verify regexes with a checksum match_regex_with_checksum operator: match and verify regexes with a checksum Sep 11, 2025
@Anilm3
Anilm3 force-pushed the anilm3/regex-checksum branch from 68e4663 to 0e45fc7 Compare September 11, 2025 16:37
@Anilm3
Anilm3 force-pushed the anilm3/regex-checksum branch from 0e45fc7 to fd278e1 Compare September 11, 2025 17:18
@Anilm3
Anilm3 marked this pull request as ready for review September 11, 2025 19:09
@Anilm3
Anilm3 requested a review from a team as a code owner September 11, 2025 19:09
@Anilm3
Anilm3 requested a review from cataphract September 11, 2025 19:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment thread src/matcher/regex_match_with_checksum.cpp Outdated
@Anilm3
Anilm3 force-pushed the anilm3/regex-checksum branch 3 times, most recently from b53faa7 to 3a1ce52 Compare September 11, 2025 20:07
@Anilm3
Anilm3 force-pushed the anilm3/regex-checksum branch from 3a1ce52 to bd40fe8 Compare September 11, 2025 20:40
@Anilm3

Anilm3 commented Sep 12, 2025

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment thread src/checksum/luhn_checksum.cpp
Comment thread src/checksum/luhn_checksum.cpp Outdated
Comment thread src/checksum/base.hpp Outdated
@Anilm3
Anilm3 enabled auto-merge (squash) September 18, 2025 14:31
@Anilm3
Anilm3 merged commit 2a8a7f6 into master Sep 18, 2025
57 of 58 checks passed
@Anilm3
Anilm3 deleted the anilm3/regex-checksum branch September 18, 2025 14:57
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