Wildcards

I was trying to make a button for removing rounded brackets and anything they contain by first making it in the advanced rename area.

I wanted to use the * wildcard so I would find (*) and replace with nothing.
It doesn't appear that wild cards work. What can I do instead?

Thanks in advance.

The rename window's Find and Replace mode doesn't use wildcards at all.

I don't think the Wildcards mode could do this since you want to keep the parts before and after what you match but remove the middle.

The Regular Expressions mode can do it, though. Here's one way to do it:

Old name: (.) ([^)]) (.*)
New name: \1 \2


Since ( and ) have special meaning in regular expressions, they have to be escaped as ( and ), which makes the regular expression look a bit more complicated. Let's break it down:

[ul]li -- Matches anything, and remembers it so we can use \1 to insert it later.

[/li]
[li]( -- Matches a '('

[/li]
[li][^)]* -- Matches anything up to and not including a ')'

[/li]
[li]) -- Matches a ')'

[/li]
li -- Matches anything else, and remembers it so we can use \2 to insert it later.[/li][/ul]

Thead split: Discussion about how regexps should work in Opus split into a separate thread: Regular expression modes & syntax.