From d1255961020185a3d4e8712f44bfe50add295039 Mon Sep 17 00:00:00 2001 From: thatfuckingbird <67429906+thatfuckingbird@users.noreply.github.com> Date: Tue, 27 Sep 2022 09:19:57 +0200 Subject: [PATCH] regex fix for system:hash in predicate parser --- hydrus/external/SystemPredicateParser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydrus/external/SystemPredicateParser.py b/hydrus/external/SystemPredicateParser.py index 311750e4..16f3e8f4 100644 --- a/hydrus/external/SystemPredicateParser.py +++ b/hydrus/external/SystemPredicateParser.py @@ -282,7 +282,7 @@ def parse_value( string: str, spec ): return string[ len( match[ 0 ] ): ], (hashes, distance) raise ValueError( "Invalid value, expected a list of hashes with distance" ) elif spec == Value.HASHLIST_WITH_ALGORITHM: - match = re.match( '(?P[0-9a-f]+((\s|,)+[0-9a-f]+)*)((with\s+)?algorithm)?\s*(?Psha256|sha512|md5|sha1|)', string ) + match = re.match( '(?P([0-9a-f]+(\s|,)+)+)((with\s+)?algorithm)?\s*(?Psha256|sha512|md5|sha1|)', string ) if match: hashes = set( hsh.strip() for hsh in re.sub( '\s', ' ', match[ 'hashes' ].replace( ',', ' ' ) ).split( ' ' ) if len( hsh ) > 0 ) algorithm = match[ 'algorithm' ] if len( match[ 'algorithm' ] ) > 0 else 'sha256'