Skip to content

Main content

Robots Directive Colon Value Token Tool

Calculate robots directive colon value token from explicit caller-supplied inputs.

Loading tool…

Description

Lowercase the name, remove the value from the first # onward, trim its edges, and return directive and value.

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.

Lowercase the name, remove the value from the first # onward, trim its edges, and return directive and value.

When to use this tool

Use Robots Directive Colon Value Token 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

  1. Enter line. 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 directive, value. Use the output convention below.

Accept an ASCII-letter directive name with letters/hyphens followed by optional spaces/tabs, a colon, and a value without CR or LF. Lowercase the name, remove the value from the first # onward, trim its edges, and return directive and value.1

Input fieldMeaning and unitsAccepted input
lineOne supplied line under the stated newline policy.Required. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
directiveDirectiveRequired. Text; maximum UTF-16 length 8192.
valueValueRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "line": "Disallow: /private # comment"
  },
  "output": {
    "directive": "disallow",
    "value": "/private"
  }
}

Limitations and assumptions

  • Unknown directive names are accepted and percent-encoded text is not decoded. This does not parse robots.txt groups, select a user agent, interpret matching rules, or establish permission to access a resource.
  • 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

  1. Calculation and input contract: parse/robots-directive-colon-value-token — tool.io

Similar or alternative tools