Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sub() STDLIB function: formalize the syntax for using capturing groups in the replace string #705

Open
a-frantz opened this issue Feb 17, 2025 · 0 comments
Labels
K-clarification (Kind) Clarifications regarding the WDL specification. S02-needs-owner (State) An issue that needs an individual to write an RFC. T-stdlib (Topic) Issues related to the standard library. Z-specification-change (Metadata) An issue or PR related to a specification change.

Comments

@a-frantz
Copy link

The SPEC (https://github.com/openwdl/wdl/blob/wdl-1.2/SPEC.md#sub) is explicit that the pattern string must be POSIX ERE compliant, but doesn't say anything about what's permitted in the replace string. This leaves it up to the engine whether capturing groups from the RE can be used in the replace string, and there isn't any uniformity as to the syntax for that, leading to non-portable WDL.

e.g. sprocket uses the regex crate which supports $<ref> syntax for capturing groups in the replace string. I think that miniwdl uses \<ref> syntax (or that's the syntax for the Python sub() func). No idea what cromwell does.

One standard should be enforced instead of leaving it up to the engine. I don't think the specific standard ($ref or \ref) matters, so long as it's portable across engines.

@github-actions github-actions bot added the S01-needs-triage (State) An issue that needs triaging. label Feb 17, 2025
@claymcleod claymcleod added Z-specification-change (Metadata) An issue or PR related to a specification change. K-clarification (Kind) Clarifications regarding the WDL specification. S02-needs-owner (State) An issue that needs an individual to write an RFC. T-stdlib (Topic) Issues related to the standard library. and removed S01-needs-triage (State) An issue that needs triaging. labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
K-clarification (Kind) Clarifications regarding the WDL specification. S02-needs-owner (State) An issue that needs an individual to write an RFC. T-stdlib (Topic) Issues related to the standard library. Z-specification-change (Metadata) An issue or PR related to a specification change.
Projects
None yet
Development

No branches or pull requests

2 participants