I am dealing with string paths with have an array index in them, indicated by [#] where # is the index. This index can be anything. What I am trying to do is to in my path string, remove all the [#] occurrences. So brackets and anything within brackets to be removed. I see the replace function but I am not sure how to use an arbitrary “middle” between the brackets to replace.
I want to remove from '[' to ']' and replace this with ''.
Ex path: Number[2].padding[1] reduced to Number.padding.
Right now I have something like :
replace(path, '[%]', '')
Where I'm trying to use % as a wildcard, but it is not functioning.