# Use Question Mark as wildcard character in Standard Rename?

**URL:** <https://resource.dopus.com/t/use-question-mark-as-wildcard-character-in-standard-rename/10363>\
**Category:** Help & Support\
**Created:** [February 8, 2011, 1:09am UTC](https://resource.dopus.com/t/use-question-mark-as-wildcard-character-in-standard-rename/10363 "2011-02-08T01:09:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Bellune](https://resource.dopus.com/letter_avatar_proxy/v4/letter/j/7c8e57/32.png) [@Jeff\_Bellune](https://resource.dopus.com/u/Jeff_Bellune)\
**Post date:** [February 8, 2011, 1:09am UTC](https://resource.dopus.com/t/use-question-mark-as-wildcard-character-in-standard-rename/10363/1 "2011-02-08T01:09:17Z")

</div>

Simple or Advanced Rename dialog, I can't type or paste a question mark as a wildcard character. If I read the "Pattern Matching Syntax" appendix of the help files correctly, it should be allowed.

I wanted to change files with names like:  
0101.png  
0102.png  
0201.png  
0202.png  
Etc...

To:  
01\_01.png  
01\_02.png  
Etc...

Since the last 2 digits were always either 01 or 02, I used:  
Old name: _0_.png  
New name: _\_0_.png

which worked.

I wanted to use:  
Old Name: \*.png  
New Name: ??\_??.png

I don't know if it would have worked the way I wanted, but DOpus never gave me the chance to try because I couldn't enter the question marks in the New Name field.

Windows 7 x64  
DOpus x64 version 9.5.6.0.3937

Thanks,  
-Jeff

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [February 8, 2011, 8:00am UTC](https://resource.dopus.com/t/use-question-mark-as-wildcard-character-in-standard-rename/10363/2 "2011-02-08T08:00:02Z")

</div>

When using wildcards outside of renaming you can use ? to match any single character.

You can't use ? when renaming, though. It is not supported as a find/replace pattern for wildcards. Only \* is, to keep things simple.

Even if ? was supported when renaming, if you're matching \*.png and replacing it with ??\_??.png: You've got one \* pattern in the old name and four ? patterns in the new name; the patterns being found don't correspond to the patterns being replaced.

If it was supported the syntax would probably be like this:

Old name: ????.png  
New name ??\_??.png  
Type: standard rename (i.e. wildcards)

Since the wildcard syntax doesn't provide a way to specify which matched pattern is to be inserted in the new name, allowing ? probably wouldn't be a good idea. Wildcards are only suited to very simple find and replace patterns.

You can do what you were trying to do using [regular expressions](https://resource.dopus.com/t/regexp-basics-removing-characters-from-start-end-of-names/5400/1):

Old name: b(..).png[/b]  
New name: \1\_\2.png  
Type: regular expressions

---

<div class="post-metadata">

**Author:** ![Jeff\_Bellune](https://resource.dopus.com/letter_avatar_proxy/v4/letter/j/7c8e57/32.png) [@Jeff\_Bellune](https://resource.dopus.com/u/Jeff_Bellune)\
**Post date:** [February 8, 2011, 11:07am UTC](https://resource.dopus.com/t/use-question-mark-as-wildcard-character-in-standard-rename/10363/3 "2011-02-08T11:07:03Z")

</div>

Thanks, leo. I appreciate you taking the time to post the "why not" of the ? character, as well as a Regular Expressions solution.

-Jeff

---

<div class="post-metadata">

**Author:** ![Jeff\_Bellune](https://resource.dopus.com/letter_avatar_proxy/v4/letter/j/7c8e57/32.png) [@Jeff\_Bellune](https://resource.dopus.com/u/Jeff_Bellune)\
**Post date:** [February 8, 2011, 1:50pm UTC](https://resource.dopus.com/t/use-question-mark-as-wildcard-character-in-standard-rename/10363/4 "2011-02-08T13:50:22Z")

</div>

At the risk of going off-topic a bit, I have regexp logic question.

I have a similar directory to the one I outlined above, but it contains some oddball files. They all start with 2 digits, but then there is sometimes a string of letters before the last 2 digits in the stem of the file name. I want DOpus to ignore the files with letters in the file names. Like so:

01MRQ01.png  
02CSB02.png  
0201.png  
18CSB01.png  
1801.png

In that list, I only want 0201.png and 1801.png to be renamed, and I want them renamed to 02\_01.png and 18\_01.png. The regexp that worked was:

Old Name: ([^a-z]+)(..).png  
New Name: \1\_\2.png

So is the regexp evaluation logic essentially, "Find as many non-letter characters as you can before the last 2 characters of the stem"? Is there a better way (or even just a different way) to approach this problem? I'm trying to understand the logic so that in the future I don't have to spend as much time trying (and mostly failing) to rename a large group of files.

-Jeff

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [February 8, 2011, 2:11pm UTC](https://resource.dopus.com/t/use-question-mark-as-wildcard-character-in-standard-rename/10363/5 "2011-02-08T14:11:45Z")

</div>

> [@](#):
>
> So is the regexp evaluation logic essentially, "Find as many non-letter characters as you can before the last 2 characters of the stem"?

Yes, that's right.

You could also use:

Old Name: ([0-9]+)([0-9][0-9]).png  
New Name: \1\_\2.png

That would ensure only digits are matched and insert an underscore before the 2nd last digit in the name. It'll work with one or more digits before where the underscore is to be inserted.

If you want it to only match four-digit filenames then you could use this:

Old Name: ([0-9][0-9])([0-9][0-9]).png  
New Name: \1\_\2.png

---

<div class="post-metadata">

**Author:** ![Jeff\_Bellune](https://resource.dopus.com/letter_avatar_proxy/v4/letter/j/7c8e57/32.png) [@Jeff\_Bellune](https://resource.dopus.com/u/Jeff_Bellune)\
**Post date:** [February 8, 2011, 3:09pm UTC](https://resource.dopus.com/t/use-question-mark-as-wildcard-character-in-standard-rename/10363/6 "2011-02-08T15:09:29Z")

</div>

Thanks, leo! It's always good to get a different perspective. Your approach seems to attack the problem from the "look for this" angle whereas mine leaned towards "ignore that". I think I like yours better...

-Jeff

---

<div class="post-metadata">

**Author:** ![darkuni](https://resource.dopus.com/user_avatar/resource.dopus.com/darkuni/32/48194_2.png) [@darkuni](https://resource.dopus.com/u/darkuni)\
**Post date:** [February 8, 2011, 9:26pm UTC](https://resource.dopus.com/t/use-question-mark-as-wildcard-character-in-standard-rename/10363/7 "2011-02-08T21:26:33Z")

</div>

I really respect the RegEx wizards out there ... I mean, it's one of the coolest most powerful things around, and I can BARELY use it ... pretty much the extent of the first example above is as far as I can go without help (even RegEx Buddy and similar tools don't help me).

So bravo for those that have tamed it's power!
