Regular Expressions in the Clipboard

In my current customer project, I write protocols almost daily, which are stored in SharePoint. In the e-mail to the participants I then link to the stored protocol. But the URL does not look very nice:

Displayed text contains only the file name in the Microsoft Outlook dialog for edit link When I edit the link it is a bit tiring to cut out the file name in the small Edit Hyperlink window. Can’t that just be automated with a regular expression?

The chrome extension “Skim the clipboard” can manipulate the clipboard with regular expressions. With pressing just one key combination Chrome can extract the file name from the long link:



  • install the Chrome extension Skim the clipboard
  • Open Chrome extension options and press “Add a row (text field)”
Field Input
Name SharePoint file name
Regular Expression .*\/([^\?]*).*
Substitute $1
Keep in clipboard
Shortcut one

The long URL is replaced in the clipboard by the file name as the first partial result ($1). For this, everything before the last slash (.*\/) ignored first. In the round brackets the file name is then the result. Here we take everything up to the question mark ([^\?]*). The remaining part (.*) is then ignored again. The replacement should be done when the extensions key combination “one” is pressed in Chrome.

  • Open chrome://extensions/, click on the menu in the upper left corner, select “Keyboard shortcuts” and choose a key combination for “run shortkey one”, e.g. ⇧⌘Y for Mac OS X