Description
Locate the first explicitly allowed equals/colon delimiter in one restricted unquoted INI key line; no sections, escaped delimiters, comments or continuation syntax.
INI-style configuration formats share section, assignment, and comment conventions but differ across implementations. Delimiters and whitespace policies need to be explicit, especially inside quoted or escaped values. A local split or prefix check should be interpreted under its stated dialect.
Locate the first explicitly allowed equals/colon delimiter in one restricted unquoted INI key line; no sections, escaped delimiters, comments or continuation syntax.
When to use this tool
Use Parsing: Ini Key Assignment Delimiter Position when you need this specific INI-style assignment, section, or comment check under an explicit policy.
How to use the tool and how it works
- Enter line, allowedDelimiters. 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 allowedDelimiters to contain only one or more = or : characters and a line without CR/LF or a leading comment/section marker. Find the first permitted delimiter at a UTF-16 offset, trim the preceding key, and preserve rawValue after it. If absent, return offset=-1, delimiter="", trimmed whole-line key, and 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. |
| allowedDelimiters | Allowed Delimiters | 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.delimiterOffset | Zero-based UTF-16 offset, or -1 for no delimiter. | Calculated result member: number. |
| result.delimiter | Delimiter | Calculated result member: string. |
| result.key | Key | Calculated result member: string. |
| result.rawValue | Untrimmed text after the first delimiter, or empty if absent. | Calculated result member: string. |
{
"input": {
"line": " key : a=b",
"allowedDelimiters": "=:"
},
"output": {
"result": {
"delimiterOffset": 5,
"delimiter": ":",
"key": "key",
"rawValue": " a=b"
}
}
} Limitations and assumptions
- Empty keys and delimiter-free lines can succeed. No quote/escape awareness, inline comment stripping, key validation, interpolation, or full INI dialect is implemented.
- 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 the target application's INI dialect for a complete configuration parser. Verify quoting, comments, interpolation, duplicate keys, and section state beyond one local split.
References
Similar or alternative tools
- Parsing: Dotenv Single Assignment Split
Split a restricted dotenv assignment at its first equals sign, retaining raw value and optional export prefix without evaluating quoting, interpolation or comments.
- Ini Comment Leading Space Policy
Apply an explicitly supplied leading-horizontal-whitespace policy for full-line INI comments.