This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* CUSTOMIZATIONS | |
| ------------------------------------------------------------------------------------------------- | |
| $path: the path of the folder containing the es.exe executable, with a final | |
| slash. | |
| $paper: the base name of the paper folder containing the search results, without | |
| extension; | |
| $mode: controls how the minus sign, which introduces switches in es.exe, is | |
| treated/escaped. Three modes are available. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Single-line version: | |
| (?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:[a-z]{2,13})(?:[^\s()<>{}\[\]]+|\([^\s()]*?\([^\s()]+\)[^\s()]*?\)|\([^\s]+?\))+(?:\([^\s()]*?\([^\s()]+\)[^\s()]*?\)|\([^\s]+?\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’])|(?:(?<!@)[a-z0-9]+(?:[.\-][a-z0-9]+)*[.](?:[a-z]{2,13})\b/?(?!@))) | |
| # Commented multi-line version: | |
| (?xi) | |
| \b | |
| ( # Capture 1: entire matched URL | |
| (?: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| import codecs | |
| encoded_text = open(sys.argv[-1], 'rb').read() | |
| bom= codecs.BOM_UTF16_LE | |
| assert encoded_text.startswith(bom) | |
| encoded_text= encoded_text[len(bom):] |
OlderNewer