REGEX + Find and replace

I created a Rename expression and I'm trying to use this expression to copy part of a name from a file, through CLIPBOARD COPYNAMES=nopaths REGEXP.

However, the expression I created only works in regular expression + find and replace mode, not in regular expression only.

How can I make the command consider Regular Expression + Find and replace mode instead of just Regular Expression?

The expression I created is designed to capture everything before the first dot " . "in the filename
,
CLIPBOARD COPYNAMES=nopaths REGEXP "(*)."

Is this what you are looking for ?

Clipboard COPYNAMES=nopaths REGEXP ([^\.]*)\..* \1
1 Like

Thank you very much, it worked perfectly

I'm glad this worked for you !
That is what I thought you were attempting to accomplish.

In Directory Opus Commands, a filename Regular Expression match is the entire filename.
This is a little different than Regular Expression use in scripting languages where a match is only for a part of a string.

Regular Expression syntax is well worth learning within Directory Opus.
Remember that a Regular Expression match search will run right to left until it finds a match.
There are many advantages to using Regular Expressions that require an entire filename to match.

Disclaimer: Recent versions of Directory Opus have a rename option of excluding the file extension from the rename match. In this case, it doesn't matter at all. It is a good example to learn from.

1 Like

Very useful information, thank you.

I try to follow the examples in the manual and some forum threads, but the regular expression syntax still seems a bit complex to me :smile: