Created
July 31, 2021 15:45
-
-
Save EmmaB/5c74862c0296b2b70b27d79c10d626ca to your computer and use it in GitHub Desktop.
Proofreading regexps
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
% Search for *} and replace with \section{}} | |
% Tag up chapters with \chapter{}, and \chapter*{} if you want to skip the numbering. | |
% Go through error notifications and resolve overflows with a forced hyphen or otherwise | |
% Spellcheck | |
% Commas and full stops outside quotation marks | |
% ’[.,] | |
% e.g. ‘It doesn’t sound like it to me’, she said. | |
% quotation marks the wrong way around | |
% (?!^([^’\r\n]++|’[^’\r\n]*’)*$)^.+ | |
% e.g. ‘It doesn’t sound like it to me‘, she said. | |
% and for double quotes | |
% (?!^([^“”\r\n]++|“[^“”\r\n]*”)*$)^.+ | |
% A instead of An | |
% a [aeiou][^unique][^unicorn] | |
% e.g. a umbrella | |
% missing capital after full stop | |
% [^.][^A-Z]\. [a-z] | |
% e.g. ...she said. and then I realised | |
% missing brackets | |
% \([^)]*$ | |
% e.g. I said (and this was the funny thing "Why not?" | |
% Duplicated word | |
% \b(\w+)\b \b\1\b | |
% e.g. she was along along. | |
% Unbalanced Quotes | |
% ^(?!(?:‘(?:[a-z][‘’][a-z]|[^‘’\r\n])*+’|(?:[a-z][‘’][a-z]|[^‘’\r\n]))*$).* | |
% Double space | |
% \s\s | |
% ‘It doesn’t sound like it to me’ she said. | |
% proper dashes , non regex search | |
% - | |
%to | |
% — | |
% balanced dashes | |
% - [^-]+ – | |
% e.g. We both knew - deep down in our waters — that | |
% balanced en dashes (include the leading space) | |
% — [^–]+ - | |
% e.g. We both knew — deep down in our waters - that | |
% balanced em dashes | |
% — [^—]+ - | |
% e.g. We both knew — deep down in our waters - that | |
% balanced em to en dashes | |
% — [^—]+ – | |
% e.g. We both knew — deep down in our waters — that | |
% missing space after comma | |
% [,][^'"’” ] | |
% space before comma | |
% \s[,] | |
% no space after comma, except }, ’ and space | |
% [.][^}’ ] | |
% reversed apostrophe | |
% \b‘ | |
% he‘d | |
%em dash with reversed apostrophe | |
% —‘ | |
%dash dash with reversed apostrophe | |
%-‘ | |
% dash with spaces | |
% - | |
% dash with apostrophe | |
%-’ | |
% dash with curly | |
%-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment