{"record":{"id":"70327694335db9e7","repo":"apache/druid","slug":"incorrect-regex-s-no-match-found","errorCode":null,"errorMessage":"Incorrect Regex: %s . No match found.","messagePattern":"Incorrect Regex: (.+?) \\. No match found\\.","errorType":"exception","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/data/input/impl/RegexReader.java","lineNumber":89,"sourceCode":"  @Override\n  public List<InputRow> parseInputRows(String intermediateRow) throws ParseException\n  {\n    return Collections.singletonList(MapInputRowParser.parse(getInputRowSchema(), parseLine(intermediateRow)));\n  }\n\n  @Override\n  protected List<Map<String, Object>> toMap(String intermediateRow)\n  {\n    return Collections.singletonList(parseLine(intermediateRow));\n  }\n\n  private Map<String, Object> parseLine(String line)\n  {\n    try {\n      final RegexMatcher matcher = compiledPattern.matcher(line);\n\n      if (!matcher.matches()) {\n        throw new ParseException(line, \"Incorrect Regex: %s . No match found.\", pattern);\n      }\n\n      final List<String> values = new ArrayList<>();\n      for (int i = 1; i <= matcher.groupCount(); i++) {\n        values.add(matcher.group(i));\n      }\n\n      if (columns == null) {\n        columns = ParserUtils.generateFieldNames(matcher.groupCount());\n      }\n\n      return Utils.zipMapPartial(columns, Iterables.transform(values, transformationFunction));\n    }\n    catch (Exception e) {\n      throw new ParseException(line, e, \"Unable to parse row [%s]\", line);\n    }\n  }\n","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/data/input/impl/RegexReader.java#L71-L107","documentation":"RegexReader.parseLine throws this ParseException when the configured regular expression does not match the input line. The regex must match the entire line (matcher.matches()), and any non-matching line is rejected with the pattern included in the message.","triggerScenarios":"A log/input line whose structure does not fully match the configured pattern - e.g. the line is blank, a comment, or from a different log format.","commonSituations":"Regex written for find() semantics but matches() requires full-line coverage (missing anchors or .*), multiline log entries split across lines, empty trailing lines, mixed log formats in one file.","solutions":["Adjust the regex so it matches the full line and all expected lines","Add anchors or optional groups for variable line shapes","Filter out blank/comment lines before parsing","Set high maxParseExceptions to skip unmatched lines during ingestion"],"exampleFix":"// before\n\"pattern\": \"(\\\\d+)\"  // fails on lines with extra text\n// after\n\"pattern\": \"^.*?(\\\\d+).*$\"","handlingStrategy":"validation","validationCode":"Pattern p = Pattern.compile(pattern); if (!p.matcher(sampleLine).matches()) { /* pattern does not fully match line */ }","typeGuard":"boolean lineMatches(String line, String pattern) { return Pattern.compile(pattern).matcher(line).matches(); }","tryCatchPattern":"try { reader.read(); } catch (ParseException e) { log.warn(\"Line did not match regex: {}\", e.getMessage()); }","preventionTips":["Remember matches() requires the full line - add anchors or .* where needed","Test the regex against several real sample lines","Skip blank/comment lines before parsing"],"tags":["regex","parse","ingestion"],"backgroundTag":"invalid-regex-pattern","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}