Thank you, Dennis:

https://issues.apache.org/jira/i#browse/LUCENE-5839

From: Dennis Walter [mailto:dennis.wal...@gmail.com]
Sent: Sunday, July 20, 2014 2:52 PM
To: dev@lucene.apache.org
Subject: Bug in AnalyzingQueryParser Pattern


Hi there,

While reading the source code of AnalyzingQueryParser to understand what it 
does, I think I found a bug in the regular expression used to detect wildcards. 
It is defined as

  // gobble escaped chars or find a wildcard character
  private final Pattern wildcardPattern = 
Pattern.compile("(\\.)|([?*]+)")<file:///\\.)|([%3f*]+)%22)>;

The first group will match a literal dot ("."), while its intention seems to be 
to match a backslash and a single character. So the expression should instead 
be "(\\\\.)|([?*]+)<file:///\\\.)|([%3f*]+)>"

Best Regards
Dennis

Reply via email to