Using Wildcards in String Inspecting

Can someone please explain to me how to use wildcards correctly?
My end goal is to create a script that replaces any material asset that ends with (number) with the same asset without that suffix.

Hello,
Maybe this way

cordially
christian.stan

Assuming that only the names with a number have parenthesis, you can use string contains and search for " ( " or " ) " and filter the list that way.

Or you can use what you got and change the code block to " ) ".

image

1 Like

Unfortunately there are some appearance assets with parenthesis in the name, so that approach to filtering isn’t great here. Am I wrong to think the * should be the way to represent a wildcard?

With the Clockwork package
(for codes)

edit: I made a syntax error about the incoming Regex"

cordially
christian.stan

1 Like

Similar method as what @christian.stan suggests. Instead of using asterisk, create your search list and use Strings.SearchListForStringContains from Lunchbox.

3 Likes

Great thanks, is there something similar I can do for duplicates beyond 9? For example I have an example project with Generic (60) asset name.

I don’t mind having multiple passes to filter the list down.

1 Like

Just change the 9 to 60 or whatever number you want to set the max range to. I just used 9 for the example. If you will never have any with (0) in the name, then start the range at 1. Change to [1…60] in the code block.

1 Like

That simple! Thanks.

hello
change in 2 code blocks and cross product

cordially
christian.stan

2 Likes