Description
Split a value at its first comment marker satisfying a supplied boundary policy.
Text parsers operate on an explicit source grammar and boundary policy. Recognizing delimiters or removing one prefix is distinct from validating the surrounding document or protocol. Preserve whether an output represents raw source spelling or decoded text, especially where quoted empty values, ASCII escapes, case and whitespace affect interpretation.
Split a value at its first comment marker satisfying a supplied boundary policy.
When to use this tool
Use Ini Inline Comment Boundary Policy when you already have valueText, commentMarker, requireWhitespaceBefore and need to split a value at its first comment marker satisfying a supplied boundary policy.
How to use the tool and how it works
- Enter valueText, commentMarker, requireWhitespaceBefore. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read valueBeforeComment, commentText, commentFound. Inspect commentFound before interpreting the associated values.
Require commentMarker nonempty; scan left to right. With requireWhitespaceBefore, accept only position zero or a marker preceded by ASCII space/tab. Return untrimmed value/comment slices and commentFound.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| valueText | Value Text | Required. Text; maximum UTF-16 length 8192. |
| commentMarker | Comment Marker | Required. Text; minimum UTF-16 length 1; maximum UTF-16 length 8192. |
| requireWhitespaceBefore | Only ASCII space/tab or position zero qualifies; quoting is not recognized. | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| valueBeforeComment | Value Before Comment | Required. Text; maximum UTF-16 length 8192. |
| commentText | Comment Text | Required. Text; maximum UTF-16 length 8192. |
| commentFound | Comment Found | Required. Boolean. |
{
"input": {
"valueText": "red ; note",
"commentMarker": ";",
"requireWhitespaceBefore": true
},
"output": {
"valueBeforeComment": "red ",
"commentText": " note",
"commentFound": true
}
} Limitations and assumptions
- No quote or escape handling is applied; marker text can be multiple characters, and a marker inside quoted wording still splits.
- 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
Use a parser for the complete intended grammar and dialect when document validity matters. Keep source spelling, decoded values, quote/escape context and whitespace rules explicit; these helpers intentionally operate on one delimiter, prefix, field or protocol component.
References
Similar or alternative tools
- Dotenv Export Prefix Token
Remove an exact leading dotenv export prefix when present.
- CSV Empty Quoted Field Distinction
Distinguish an unquoted empty source field from a quoted empty source field.