value - Parse values

Added in version PLT-OS: v2.0.30

Extract data from a value.

Usage:

- command: value <payloadText>
  [expect: [hex] <expectText>]
  [extract: <extractText>]
  [extractKey: <key>...]

Argument

Description

expectText

Text to expect, prior to extraction. If the hex keyword is used, expectText is interpreted as a hex string.

extractText

Regular expression to extract (uses RE2 Syntax, except \C)

key

Key(s) in which to store extracted text. To save multiple values, use multiple capture groups.

Examples

# Extract 2 capture groups
- command: define TEXT "Foobar1234"
- command: value "%TEXT%"
  extract: "^(\\D+)(\\d+)$"
  extractKey: ALPHA DIGITS
# Match hex values
- command: value "ABC"
  expect: hex 414243