Hello Ben,
no, you cannot use placeholders like this in CSS selectors, only direct (partial) comparison.
There are two common ways to select WebElements in Selenium (which Geb is built on top of).
1. By CSS selectors, which is the the default in Geb, if you just pass a String to the $-method
2. By XPath, which you can do by passing a Selenium-"By"-object to the $-method, like this: $(By.xpath("//div"))
XPath gives you much more options, as it really is a small programming language, that allows you to traverse the tree of HTML in pretty much any way you could imagine, including matching of regular expressions.
With XPath, it could work like this:
$(By.xpath("//*[matches(@name, '
parentobject.childlist[\\d].thing')]"))
i.e. using "\d", which means "digit" in regular expressions as the wildcard (and escaping that with another backslash because its a Java-String).
Another option, using only CSS selectors, could be to combine a start-of-string with an end-of-string selector, like this:
$("[name^='parentobject.childlist['][name$='].thing']")
Best Regards,
Thomas