strip strings in loop, update filters
@@ -79,8 +79,8 @@ def hex(i):
return "0x%X" % (i)
-FP_FILTER_PREFIXES = re.compile(r"^.?((p|P|0)?VA)|0\\A|P?\\A|\[A") # remove string prefixes: pVA, VA, 0VA, etc.
-FP_FILTER_SUFFIXES = re.compile(r".*[0-9A-G>]VA$") # remove string suffixes: 0VA, AVA, >VA, etc.
+FP_FILTER_PREFIXES = re.compile(r"^.?((p|P|0)?VA)|(0|P)?\\A|\[A|P\]A|@AA") # remove string prefixes: pVA, VA, 0VA, etc.
+FP_FILTER_SUFFIXES = re.compile(r".*([0-9A-G>]VA$|@AA)$") # remove string suffixes: 0VA, AVA, >VA, etc.
FP_FILTER_CHARS = re.compile(r".*(AAA|BBB|CCC|DDD|EEE|FFF|UUU|ZZZ|@@@|;;;|\?\?\?|\|\|\|| ).*")
# alternatively: ".*([^0-9wW])\1{2}.*" to match any 3 consecutive chars (except numbers, ws, and others?)
@@ -99,4 +99,6 @@ def strip_string(s):
:param s: input string
:return: string stripped from FP pre- or suffixes
"""
- return re.sub(FP_FILTER_PREFIXES, "", re.sub(FP_FILTER_SUFFIXES, "", s))
+ for reg in (FP_FILTER_PREFIXES, FP_FILTER_SUFFIXES):
+ s = re.sub(reg, "", s)
+ return s
