Regex in copynames

i'm wanting a series of commands that copy the UNC paths and filenames, but replaces all "" with either "\" or "/". so far i have

Clipboard COPYNAMES=unc

but im struggling with the regular expression

Clipboard COPYNAMES=unc REGEXP (.*)\\(.*)# \1/\2

Awesome, Leo. Thanks!

I tried to surround the result in quotes like this

Clipboard COPYNAMES=unc  REGEXP (.*)\\(.*)# "\1/\2"

but i wound up getting lots more quotes around the string than i wanted

That happens because of the # at the end of the pattern which makes Opus apply it repeatedly until the string stops changing. (Without that, only one of the backslashes would be changed.)

The REGEXP argument lets you give multiple patterns so you can use this to get what you want:

Clipboard COPYNAMES=unc REGEXP (.*)\\(.*)# \1/\2 (.*) ""\1""

If you still get multiple quotes, try this:

Clipboard COPYNAMES=unc REGEXP (.*)\\(.*)# \1/\2 (.*) "\1"

For me the first one works, but it looks like you were getting quotes without having to double them up, so maybe the first version will give you two pairs of quotes and the second one won't.

Fabulous Leo!