Skip to content

Add regex support for optional dependencies#56

Open
NinFreakinJa wants to merge 2 commits into
nbgallery:masterfrom
NinFreakinJa:patch-1
Open

Add regex support for optional dependencies#56
NinFreakinJa wants to merge 2 commits into
nbgallery:masterfrom
NinFreakinJa:patch-1

Conversation

@NinFreakinJa

Copy link
Copy Markdown

Additional regex to support the specification of optional dependencies/extras for a package. Current behavior will match the extra name within the '[]' rather than the package + specified extra.

@NinFreakinJa NinFreakinJa marked this pull request as ready for review May 3, 2026 08:30
@billallen256

Copy link
Copy Markdown
Collaborator

Note that this still allows mistakes like abc[DEF HIJ, which will return three package names. However, short of implementing the full grammar, I'm not sure of a way around this. Also, the intent of the regex is to prevent malicious strings, not mistakes. Curious if there are other thoughts before merging this though.

@NinFreakinJa

Copy link
Copy Markdown
Author

Note that this still allows mistakes like abc[DEF HIJ, which will return three package names. However, short of implementing the full grammar, I'm not sure of a way around this. Also, the intent of the regex is to prevent malicious strings, not mistakes. Curious if there are other thoughts before merging this though.

That is a good point. I also don't immediately see a way around this without even further extending the regex to check for when whitespace is and isn't allowed in the grammar.

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.

2 participants