tasks icon indicating copy to clipboard operation
tasks copied to clipboard

escape sequences in regex

Open mlin opened this issue 4 years ago • 2 comments

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?)

mlin avatar Jan 10 '21 21:01 mlin

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:

rhpvorderman avatar Jan 12 '21 10:01 rhpvorderman

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.

jdidion avatar Jun 22 '21 23:06 jdidion