What does HRESULT 0x8004166C (QPARSE_E_EXPECTING_REGEX) mean?

 
Previous Next
QPARSE_E_UNSUPPORTED_PROPERTY_TYPE QPARSE_E_EXPECTING_REGEX_PROPERTY

QPARSE_E_EXPECTING_REGEX

The parser expected a regular-expression operand

QPARSE_E_EXPECTING_REGEX is HRESULT 0x8004166C. Windows documents it as “Expecting regular expression.”

Interpretation

This result belongs to legacy Windows query parsing and is returned while reading the pattern side of a regex construct. The exact condition is: the pattern is empty, lost through escaping or replaced by a delimiter/operator.

Concrete sources

Observability checklist

  • Record escaped token before releasing the relevant objects.
  • Associate delimiter form with the exact UTC timestamp and correlation identifier.
  • Compare failing and known-good values for parser offset under the same provider or handler version.
  • Record the source and normalization path of owning property, not only its display form.

Investigation order

  1. Capture user pattern and escaped token at the call boundary that returns this result.
  2. Confirm the operation reached reading the pattern side of a regex construct with the intended delimiter form.
  3. capture user pattern, language-string representation and final query token separately.

Corrective action

Provide a nonempty valid pattern; never substitute .* silently. Retrying identical parser bytes cannot succeed; regenerate the specific token or schema pairing that failed.

What must not be inferred

Neighboring status codes

QPARSE_E_EXPECTING_REGEX_PROPERTY concerns the property target, not the pattern.

Developer and administrator guidance

Reproduction example

Multiple escaping layers remove the only pattern character. Logging final parser input reveals the empty operand.

Official Microsoft references


Looking for a different code? Search another status or error code.