Question Mark wildcards in Rename dialog?

Is there any reason why the question-mark (this: ?) is no longer accepted in 12.20 in Search & Replace set to Standard Wildcard Rename? No, it's not my keyboard - that's working fine. All characters are mapped to the right places (here: !"£$%^&*()[]{}:;@'#~,<.>/ and ?).

What do I do to get it back?

? is not a legal character in file names, so you could not find it in a filename, nor replace anything else with it in one.

? can be used with wildcards and regular expressions, but the basic Find & Replace mode doesn't use either. There is a separate Find & Replace + Regular Expressions mode which should allow it to be used.

I'm not sure what you mean by "Search & Replace set to Standard Wildcard Rename"; that isn't a combination the Rename dialog supports, is it?

Or do you mean you're using Standard Wildcard Rename mode (not Find and Replace mode), and need to type ? wildcards?

In case it was that, I tried modifying the filter to allow ? keys to be typed, but they don't seem to do anything in that mode. I think the Rename dialog's Standard Wildcard Rename mode only supports * wildcards. More complex things can be done using the two modes that support Regular Expressions.

Let me know if you meant something else. Maybe an example of something which used to work and now doesn't would clarify. If you know which version it used to work in, we can see what changed since then as well.

Thanks for the reply. If you go to Rename, having selected a bunch of files, usually the default mode is "Standard Wildcard Rename", the first one in the dropdown list. It used to be that in this mode, "?" stood for one character, and "*" stood for any number of characters. There are some other codes, but I can't remember them. This all is confirmed in the help file.
So yes, I meant "Or do you mean you're using Standard Wildcard Rename mode (not Find and Replace mode), and need to type ? wildcards?".
This certainly used to work in past versions (certainly up to a few months ago).
It's kind of essential if you have a set of files with, say, DateName.ext, and want to change them to Date-Name.ext (inserting the hyphen). Yes, I can switch to RegExes, but this was useful as it was quick and easy.

ATB, JB

? is a wildcard character for things like the filter bar or the Select command, but it's never been a valid character in rename - only * was (unless you're using regex).

Well, it used to work. And the help file/manual certainly implies it works. Here's a quote from the rename page:

Rename

The Rename internal command can be used to:

  • Trigger inline rename mode, letting you quickly edit the name of a file or folder
  • Display the Rename dialog, letting you perform wildcard and scripted renames on multiple files at once
  • Perform automated rename operations
  • Embed a rename script in a button or hotkey

Here is the quote from the Wildcard page:

Wildcard Reference

There are two types of wildcard (pattern matching) systems used in Opus.

  • Standard pattern matching syntax is a simple wildcard system - if you're familiar with typing *.doc to mean all document files, you should start with this.
  • Regular expressions are a more powerful but also more complicated system that let you match much more complex patterns. They also let you perform search and replace operations, which lets you perform complex batch renames via the Advanced Rename function.

And here's the start of the pattern match page:

Pattern Matching Syntax

Wildcard patterns can be used in many functions in Opus, including:

As well as regular expressions, Opus supports a more simple wildcard system, called the standard pattern matching system. When using wildcards, you specify a pattern consisting of a mix of literal text and special wildcard tokens . Each token is used to match one or more characters in the target string. As a simple example, the pattern *.doc matches anything that ends with the literal characters .doc (or in other words, document files).

And "?" is definitely listed in the tokens.

To me, that clearly is saying that the Rename dialog supports the Wildcard pattern matching. If it doesn't, then that means you don't have two systems, you have three in DO, one being a cut-down wildcard system. I'm not only sure it worked, I'm pretty sure that I wouldn't have been able to do many mass renames with only "*".

Still, never mind. If you say it's unavailable then so be it.

ATB

John B

The documentation on the actual Rename dialog only mentions * in Standard Wildcard Rename mode:

It has always been that way, as far as I can tell.

I just installed 12.1, from 2016, to test and it also did not let you type ? into the Rename dialog when in Standard Wildcard Rename mode. So if this did change, it did not change recently and definitely did not change in 12.20. I think you're confusing the Rename dialog with something else which also accepts wildcards.

You can match single characters in Regular Expressions mode so you can still do what you want in the Rename dialog, just not using ? in wildcards mode.

Fine. Then as I said, you have three pattern-matching systems in DO, not two as documented. All I can say is that I have definitely managed to insert things using standard wildcard rename, and in most cases that will be impossible as "*" is greedy.I'll live with it.

It's not really a pattern-matching system, it's more a feature of the Rename command. Historically it actually dates from the Amiga version over 25 years ago. Here's the pertinent bit from the help file of Opus 5.11 circa 1995:

The original code actually handled this specifically as part of the rename function - it was never really a generalised wildcard system.

In the current code it's actually implemented behind the scenes using regular expressions anyway; each * in the 'from' field gets turned into a (.*) and every * in the 'to' field gets turned into an incrementing replacement sequence (\1, \2, \3 and so on).

I guess conceivably we could allow ? and turn it into (.) in the regex but is there really any reason you can't just use the regex mode for what you want to do? We kind of figured people would just use that for anything more complicated than allowed for by the "standard" mode.

1 Like

I wouldn't bother to change it - it was just a short-cut. Regex is fine. Thanks.