Strings

String literals and escape sequences in WDL

A string literal may contain any unicode characters between single or double-quotes, with the exception of a few special characters that must be escaped:

Escape SequenceMeaning\x EquivalentContext
\\\\x5C
\nnewline\x0A
\ttab\x09
\'single quote\x22within a single-quoted string
\"double quote\x27within a double-quoted string
\~tilde\x7Eliteral "~{"
\$dollar sign\x24literal "${"

Strings can also contain the following types of escape sequences:

  • An octal escape code starts with \, followed by 3 digits of value 0 through 7 inclusive.
  • A hexadecimal escape code starts with \x, followed by 2 hexadecimal digits 0-9a-fA-F.
  • A unicode code point starts with \u followed by 4 hexadecimal characters or \U followed by 8 hexadecimal characters 0-9a-fA-F.