Skip to content

extractBetween

extractBetween(string, start, end) → string · String

Extract the substring between two delimiter strings.

  • string (required): the source string

  • start (required): the start delimiter

  • end (required): the end delimiter

bash
echo '{"msg": "Hello [world] today"}' | utlx -e 'extractBetween($input.msg, "[", "]")'
# "world"
utlx
{
  tag: extractBetween($input.xml, "<name>", "</name>"),
  token: extractBetween($input.header, "Bearer ", " ")
}

Released under AGPL-3.0.