Advertisement
smeech

Sentence capitalise

Mar 18th, 2024 (edited)
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.63 KB | Software | 0 0
  1. # Espanso capitalise new sentence after period, question or exclamation mark
  2.   - regex: (?P<before>\w[.?!])\s(?P<firstchar>[a-z])(?P<therest>\w*\W)
  3.     replace: "{{before}} {{capital}}{{therest}}"
  4.     vars:
  5.       - name: capital
  6.         type: shell
  7.         params:
  8.           cmd: "echo \"${ESPANSO_FIRSTCHAR^}\""
  9.           shell: bash # or wsl for Windows (if installed)
  10. # or
  11.   - regex: (?P<before>\w[.?!])\s(?P<firstchar>[a-z])(?P<therest>\w*\W)
  12.     replace: "{{before}} {{capital}}{{therest}}"
  13.     vars:
  14.       - name: capital
  15.         type: shell
  16.         params:
  17.           cmd: echo {{firstchar}} | tr '[:lower:]' '[:upper:]'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement