Skip to content

problem with rule to regexp #15

@rriemann

Description

@rriemann

Hello,

Question regarding the line rule = re.sub("(\|)[^$]", r"\|", rule) in https://github.com/scrapinghub/adblockparser/blob/master/adblockparser/parser.py#L272 :

This would not only escape the pipe sign, but also remove the sign following the pipe.

Actual behaviour:

>>> import re
>>> rule = "iue|ie"
>>> re.sub("(\|)[^$]", r"\|", rule)
'iue\\|e'

Expected behaviour: iue\\|ie

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions