biowdl / tasks

A collection of reusable WDL tasks. Category:Other
https://biowdl.github.io/tasks/
MIT License
85 stars 31 forks source link

escape sequences in regex #270

Open mlin opened 3 years ago

mlin commented 3 years ago

I was just battening down miniwdl's parsing of escape sequences in string literals, and got tripped up here:

https://github.com/biowdl/tasks/blob/c92755e510723da731ba92637c41e58c8490b5fc/common.wdl#L219

Looking at the WDL spec on escape sequences, do you think there should be a double-backslash instead of single here? (Would that break it?)

rhpvorderman commented 3 years ago

Given that this is a regular expression there is also this issue that comes into play: https://github.com/openwdl/wdl/pull/243

In valid POSIX ERE it would be one slash, unless I am mistaken. So this makes the SPEC self-conflicting? :confused:

jdidion commented 3 years ago

I just came to report this as well. The 1.1 spec states explicitly that regexps used with sub need to be "double-escaped". Unfortunately it is not stated explicitly in 1.0, but it is implied by the example used with the sub command.