Skip to content

Main content

JSON String Line Continuation Rejection Tool

Compute json string line continuation rejection from explicit bounded inputs.

Loading tool…

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

  1. Enter lexeme. 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 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 fieldMeaning and unitsAccepted input
lexemeSupplied token spelling; it is not automatically decoded text.Required. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
continuationContinuationRequired. Boolean.
validWhether this narrowly scoped condition passes; it is not necessarily full-document validity.Required. Boolean.
json
{
  "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

  1. Calculation and input contract: json/json-string-line-continuation-rejection — tool.io

Similar or alternative tools