draft fix: make b4com name in devdb case insensitive#428
Draft
Conversation
Accept any variation b4com, B4com, B4Com, B4COM, etc. Also remove lookbehind match (repeating B4com prefix). Also remove '.*' tail match - it would forbid to add module deviations, ie hw.B4com.CS2148P.XXX
5d48679 to
a0f8a41
Compare
leenr
reviewed
Sep 16, 2025
| "B4com.CS4132U": "^[Bb]4com B4T-CS4132U.*", | ||
| "B4com.CS4148Q": "^[Bb]4com B4T-CS4148Q.*", | ||
| "B4com.CS4164U": "^[Bb]4com B4T-CS4164U.*" | ||
| "B4com": "^[Bb]4[Cc][Oo][Mm]", |
Contributor
There was a problem hiding this comment.
Suggested change
| "B4com": "^[Bb]4[Cc][Oo][Mm]", | |
| "B4com": "^(?i:B4com)", |
>>> re.match(r'^(?i:B4com)', 'B4COM')
<re.Match object; span=(0, 5), match='B4COM'>
>>> re.match(r'^(?i:B4com)', 'b4com')
<re.Match object; span=(0, 5), match='b4com'>
Contributor
Author
There was a problem hiding this comment.
I am hesitant of using inline flags here becase of https://bugs.python.org/issue39394
Is ok here since its in the begginging and local (?i:...) but I am afraid someone will copy-paste it and do not close brackets:
>>> re.compile("(?i)xxx")
re.compile('(?i)xxx', re.IGNORECASE)
>>>
>>> re.compile("xxx(?i:xxx)")
re.compile('xxx(?i:xxx)')
>>>
>>> re.compile("xxx(?i)xxx")
Traceback (most recent call last):
...
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/re/_parser.py", line 840, in _parse
raise source.error('global flags not at the start '
re.error: global flags not at the start of the expression at position 3
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.
Accept any variation b4com, B4com, B4Com, B4COM, etc.
Also remove lookbehind match (repeating B4com prefix).
Also remove '.*' tail match - it would forbid to add model deviations, ie hw.B4com.CS2148P.XXX