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:
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:
| Field | Input |
|---|---|
| Name | SharePoint file name |
| Regular Expression | .*/([^?]*).* |
| Modifier | |
| Upercase | |
| 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.