You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@mristin, First, this is a cool and helpful project. I have been working on parsing file paths and URIs and stumbled onto this.
I think it would be useful to add the ability to name the regex capture groups. I have created a PR on my fork that does this for my immediate purposes, although it would likely need some changes to integrate properly.
Is this a feature you would consider adding? If so, I might try to put together a PR.
One issue is whether this feature would be optional, which I would presume, and if so, how the configuration option should be passed down.
Another issue is duplicate group names for repeated patterns. Fortunately, the regex package handles duplicate names well, so I was able to avoid the issue for now, but Python's re module is not able to handle duplicate group names, so this feature would have limited compatibility if this issue is not addressed. Solving the issue properly is more challenging than I initially thought because of repeated nested patterns. I have a couple of thoughts, but I'd be interested in any input or ideas you might have on this.
Thanks!
The text was updated successfully, but these errors were encountered:
Hi @brl0,
Please apologize for coming back to you with such a delay. The 2023 was a busy year for me.
Is this a feature you would consider adding? If so, I might try to put together a PR.
Definitely!
One issue is whether this feature would be optional, which I would presume, and if so, how the configuration option should be passed down.
What about having a separate format, python-nested-with-named-groups?
Another issue is duplicate group names for repeated patterns. Fortunately, the regex package handles duplicate names well, so I was able to avoid the issue for now, but Python's re module is not able to handle duplicate group names, so this feature would have limited compatibility if this issue is not addressed. Solving the issue properly is more challenging than I initially thought because of repeated nested patterns. I have a couple of thoughts, but I'd be interested in any input or ideas you might have on this.
I think this would be out-of-scope of the tool. We need to avoid any dependencies in the downstream code, so adding regex is not an option for us. Perhaps you can simply patch the code at the usage site with import regex as re?
@mristin, First, this is a cool and helpful project. I have been working on parsing file paths and URIs and stumbled onto this.
I think it would be useful to add the ability to name the regex capture groups. I have created a PR on my fork that does this for my immediate purposes, although it would likely need some changes to integrate properly.
Is this a feature you would consider adding? If so, I might try to put together a PR.
One issue is whether this feature would be optional, which I would presume, and if so, how the configuration option should be passed down.
Another issue is duplicate group names for repeated patterns. Fortunately, the
regex
package handles duplicate names well, so I was able to avoid the issue for now, but Python'sre
module is not able to handle duplicate group names, so this feature would have limited compatibility if this issue is not addressed. Solving the issue properly is more challenging than I initially thought because of repeated nested patterns. I have a couple of thoughts, but I'd be interested in any input or ideas you might have on this.Thanks!
The text was updated successfully, but these errors were encountered: