Skip to content

Instantly share code, notes, and snippets.

@EmmaB
Created August 7, 2020 11:14
Show Gist options
  • Save EmmaB/d0980fefaf8bce48456709f80b315552 to your computer and use it in GitHub Desktop.
Save EmmaB/d0980fefaf8bce48456709f80b315552 to your computer and use it in GitHub Desktop.
% 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
%-}
% dash with bang
%-!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment