Created
December 15, 2020 14:52
-
-
Save kevinmorio/24e6ca50f42afdc67c9c124b64201eb3 to your computer and use it in GitHub Desktop.
ZotFile user wildcards for title and original date
This file contains 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
{ | |
"T": { | |
"field": "title", | |
"operations": [ | |
{ | |
"function": "replace", | |
"regex": "\\s*[.:;?!|].*", | |
"replacement": "" | |
}, | |
{ | |
"function": "replace", | |
"regex": " \\- ", | |
"replacement": " ", | |
"flags": "g" | |
}, | |
{ | |
"function": "replace", | |
"regex": "<i>|<\/i>|<b>|<\/b>|<sup>|<\/sup>|<sub>|<\/sub>|<span[^>]+>|<\/span>", | |
"replacement": "", | |
"flags": "g" | |
}, | |
{ | |
"function": "replace", | |
"regex": "[\\\/()~!@#$%^&*{«»„““”‘’|….,;`^<>'}+:?!®©]*", | |
"replacement": "", | |
"flags": "g" | |
}, | |
{ | |
"function": "trim" | |
} | |
] | |
}, | |
"O": { | |
"field": "extra", | |
"operations": [ | |
{ | |
"function": "replace", | |
"regex": "[\\s\\S]*original-date: (\\d{4})[\\s\\S]*|[\\s\\S].*[\\s\\S]", | |
"replacement": "$1" | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have a fine collection of operations here. I also needed to replace various dashes and used the following successfully