556 # remove trailing wildcards |
556 # remove trailing wildcards |
557 pattern = re.sub(r"(\*)$", "", pattern) |
557 pattern = re.sub(r"(\*)$", "", pattern) |
558 # escape special symbols |
558 # escape special symbols |
559 pattern = re.sub(r"(\W)", r"\\\1", pattern) |
559 pattern = re.sub(r"(\W)", r"\\\1", pattern) |
560 # process extended anchor at expression start |
560 # process extended anchor at expression start |
561 pattern = re.sub(r"^\\\|\\\|", |
561 pattern = re.sub( |
|
562 r"^\\\|\\\|", |
562 r"^[\w\-]+:\/+(?!\/)(?:[^\/]+\.)?", pattern) |
563 r"^[\w\-]+:\/+(?!\/)(?:[^\/]+\.)?", pattern) |
563 # process separator placeholders |
564 # process separator placeholders |
564 pattern = re.sub(r"\\\^", r"(?:[^\w\d\-.%]|$)", pattern) |
565 pattern = re.sub(r"\\\^", r"(?:[^\w\d\-.%]|$)", pattern) |
565 # process anchor at expression start |
566 # process anchor at expression start |
566 pattern = re.sub(r"^\\\|", "^", pattern) |
567 pattern = re.sub(r"^\\\|", "^", pattern) |