Description
Detect a backslash followed by CRLF, CR, or LF.
A JSON lexeme is its textual spelling, which differs from the decoded value. Escapes, quotes, raw control characters, and surrounding whitespace must be interpreted in context.
Detect a backslash followed by CRLF, CR, or LF.
When to use this tool
Use JSON String Line Continuation Rejection when you need a narrowly defined JSON string or separator diagnostic.
How to use the tool and how it works
- Enter lexeme. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read continuation, valid. Inspect continuation, valid before interpreting the associated values.
Detect a backslash followed by CRLF, CR, or LF. Independently try JSON.parse and return valid only for a successfully parsed string.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| lexeme | Supplied token spelling; it is not automatically decoded text. | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| continuation | Continuation | Required. Boolean. |
| valid | Whether this narrowly scoped condition passes; it is not necessarily full-document validity. | Required. Boolean. |
{
"input": {
"lexeme": "\"a\\\nb\""
},
"output": {
"continuation": true,
"valid": false
}
} Limitations and assumptions
- Malformed lexemes return valid false rather than a parser error; continuation and validity are independent flags.
- 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
Parse the entire document when validity matters; a local pattern match cannot establish complete JSON syntax.
References
Similar or alternative tools
- JSON: JSON Newline Literal Escape Check
Find literal linefeeds and carriage returns in fragment and return their zero-based UTF-16 offsets and a combined forbidden-raw-line-break flag.
- JSON: JSON String Trailing Backslash Parity
Count consecutive backslashes at fragment's end.