Skip to content
Snippets Groups Projects

RegEx easylist cleanup

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Jan Maria Kopankiewicz

    removes regular expression characters from easylist_adservers list.

    Edited
    regex_cleanup.py 320 B
    import re
    from requests import get
    
    src_file='https://raw.githubusercontent.com/easylist/easylist/master/easylist/easylist_adservers.txt'
    src = get(src_file).text
    replaced = re.sub('\|', '', src)
    replaced = re.sub('\^.*', '', replaced)
    replaced = re.sub('\!.*', '', replaced)
    
    easylist_adservers = replaced.splitlines()
    0% or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment