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
- Enter line. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| line | One supplied line under the stated newline policy. | Required. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| result | Object containing the calculated result members described below. | Required. Object. |
| result.key | Key | Calculated result member: string. |
| result.rawValue | Raw Value | Calculated result member: string. |
{
"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
Similar or alternative tools
- Css Dimension Number Unit Split
Match a signed integer or decimal number with optional exponent followed by an ASCII letter and further letters, digits, or hyphens.
- Parsing: Ini Key Assignment Delimiter Position
Locate the first explicitly allowed equals/colon delimiter in one restricted unquoted INI key line; no sections, escaped delimiters, comments or continuation syntax.