CopyQ
CopyQ copied to clipboard
Function with regex MaxMusterMann > Max Muster Mann
I'm looking for a function that inserts a space before capital letters
"MaxMusterMann" > "Max Muster Mann" "OneTwoThreeFour" > "One Two Three Four"
Can anybody help me further? thanks :)
The following command add a menu/toolbar item that splits such word in selected item (here is how to add the command to CopyQ):
[Command]
Command="
copyq:
const text = str(input());
const separated = text.replace(/[A-Z]/g, ' $&').trim();
print(separated)"
Icon=\xf1dc
InMenu=true
Input=text/plain
Name=Separate CamelCase
Output=text/plain
Separator=\\n
Transform=true
Note: This is very simple command and works only on Latin characters and single word items.