Simplify IBAN regex pattern and fix trailing character handling#1818
Merged
Conversation
Co-authored-by: SharonHart <15013757+SharonHart@users.noreply.github.com>
Co-authored-by: SharonHart <15013757+SharonHart@users.noreply.github.com>
Co-authored-by: SharonHart <15013757+SharonHart@users.noreply.github.com>
Co-authored-by: SharonHart <15013757+SharonHart@users.noreply.github.com>
Co-authored-by: SharonHart <15013757+SharonHart@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix IBAN regex pattern for trailing character matching
Simplify IBAN regex pattern and fix trailing character handling
Dec 15, 2025
Coverage report (presidio-analyzer)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
SharonHart
approved these changes
Dec 16, 2025
yuvalyaron
approved these changes
Dec 16, 2025
prokopidis
pushed a commit
to prokopidis/presidio
that referenced
this pull request
Jun 23, 2026
…osoft#1818) * Initial plan * Update IBAN regex pattern to simpler, more maintainable version Co-authored-by: SharonHart <15013757+SharonHart@users.noreply.github.com> * Fix line length linting issue in IBAN recognizer Co-authored-by: SharonHart <15013757+SharonHart@users.noreply.github.com> * Fix separator handling inconsistency in IBAN pattern Co-authored-by: SharonHart <15013757+SharonHart@users.noreply.github.com> * Add pattern documentation and fix digit representation consistency Co-authored-by: SharonHart <15013757+SharonHart@users.noreply.github.com> * Improve documentation clarity for validation fallback mechanism Co-authored-by: SharonHart <15013757+SharonHart@users.noreply.github.com> * Fix IBAN test cases and add new scenarios --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: SharonHart <15013757+SharonHart@users.noreply.github.com> Co-authored-by: Sharon Hart <sharonh.dev@gmail.com>
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.
Change Description
The IBAN recognizer used a complex regex with 8 capture groups and variable-length matching (3-5 characters). Replaced with a simpler pattern using consistent 4-character groups and 3 capture groups.
Pattern Changes
Before:
After:
Key Improvements
\b) replaced with negative lookahead/lookbehind to prevent mid-IBAN matchingBehavior
Issue reference
Issue tracking handled separately
Checklist
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.