Search a partial substring and get an argument, function/list-like but with strings
I know it's more of a C# question than an Unity question, but I'm trying to make a game where you have to type simplified code, and I'm struggling to find a substring in a string, but with an unknown part (kind of like using thing*thing2 as a joker in some search engines, meaning "I can have whatever string between thing and thing2, just look for them").
My goal is to have a string manipulation thing, where you could input "a lot of stuff, doesn't matter what name_of_list[12] still more stuff", search for "name_of_list[*]", get the chars that are between the brackets, and replace the whole searched string with the actual value in the list, for later evaluation (it would be read-only lists).
I considered using Regex.Replace() because it can get the nth character of a matching string, but I don't know how to make it work with an unknown character, let alone with an unknown number of characters between the brackets.