Skip to content

Main content

Parsing: Dotenv Single Assignment Split Tool

Split a restricted dotenv assignment at its first equals sign, retaining raw value and optional export prefix without evaluating quoting, interpolation or comments.

Loading tool…

Description

Split a restricted dotenv assignment at its first equals sign, retaining raw value and optional export prefix without evaluating quoting, interpolation or comments.

Parsing depends on the chosen grammar, character encoding, offset unit, and treatment of escapes and delimiters. UTF-16 code-unit positions, Unicode code points, and UTF-8 byte offsets are not interchangeable. A boundary or token check supplies one part of a parser rather than validating an entire file.

Split a restricted dotenv assignment at its first equals sign, retaining raw value and optional export prefix without evaluating quoting, interpolation or comments.

When to use this tool

Use Parsing: Dotenv Single Assignment Split when you need the stated token boundary, offset, prefix, delimiter, or count component inside a larger parsing workflow.

How to use the tool and how it works

  1. Enter line. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read result. Expand result to inspect the returned fields.

Require one line without CR or LF, optionally beginning with export plus one or more ASCII spaces, then an ASCII environment-style key immediately followed by =. Return key and the unmodified remainder as rawValue inside result.1

Input fieldMeaning and unitsAccepted input
lineOne supplied line under the stated newline policy.Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultObject containing the calculated result members described below.Required. Object.
result.keyKeyCalculated result member: string.
result.rawValueRaw ValueCalculated result member: string.
json
{
  "input": {
    "line": "export KEY=a=b"
  },
  "output": {
    "result": {
      "key": "KEY",
      "rawValue": "a=b"
    }
  }
}

Limitations and assumptions

  • Leading indentation, spaces around =, quoting, comment stripping, interpolation, and multiline values are not interpreted. The tool neither reads nor changes an environment and does not execute shell syntax.
  • Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Choose a parser for the intended complete grammar when context, nesting, encodings, or semantic validation matters. Keep byte, code-unit, and code-point coordinates explicit when combining results.

References

  1. Calculation and input contract: parse/dotenv-single-assignment-split — tool.io

Similar or alternative tools