Fixed Regex

This commit is contained in:
Kaustubh B 2023-08-31 11:25:29 +05:30 committed by Marek Posolda
parent 51d19c505b
commit c57e775102

View file

@ -26,7 +26,7 @@ import java.util.regex.Pattern;
* @author Vaclav Muzikar <vmuzikar@redhat.com> * @author Vaclav Muzikar <vmuzikar@redhat.com>
*/ */
public class SearchQueryUtils { public class SearchQueryUtils {
public static final Pattern queryPattern = Pattern.compile("\\s*(?:(?<name>[^\"][^: ]+)|\"(?<nameEsc>(?:\\\\.|[^\\\\\"])+)\"):(?:(?<value>[^\"][^ ]*)|\"(?<valueEsc>(?:\\\\.|[^\\\\\"])+)\")\\s*"); public static final Pattern queryPattern = Pattern.compile("\\s*(?:(?<name>[^\"][^: ]+|.)|\"(?<nameEsc>(?:\\\\.|[^\\\\\"])+)\"):(?:(?<value>[^\"][^ ]*)|\"(?<valueEsc>(?:\\\\.|[^\\\\\"])+)\")\\s*");
public static final Pattern escapedCharsPattern = Pattern.compile("\\\\(.)"); public static final Pattern escapedCharsPattern = Pattern.compile("\\\\(.)");
public static Map<String, String> getFields(final String query) { public static Map<String, String> getFields(final String query) {