Created
June 3, 2022 09:52
-
-
Save pilotmoon/4977625377674a10868621e60c7e6c69 to your computer and use it in GitHub Desktop.
PopClip extension to swap "Doe, John" to "John Doe"
This file contains 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
#popclip | |
name: Swap Name | |
icon: symbol:arrow.triangle.swap | |
after: paste-result | |
regex: '\w+, .+' | |
javascript: | | |
const match = popclip.input.text.match(/(\w+), (.+)/) | |
if (match) return match[2] + ' ' + match[1]; else return null | |
# The above block is an Extension SNippet - select it to install the extension with PopClip | |
# see https://forum.popclip.app/t/introducing-extension-snippets/309 | |
# Test inputs: | |
# Bush, George | |
# Bush, George Herbert Walker | |
# Bush, George H. W. | |
# Smith-Smythe-Smith, Tarquin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment