Skip to content

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

@a-frantz

Description

@a-frantz

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.

Metadata

Metadata

Assignees

No one assigned

    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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions