The SNOBOL/regular expressions thread brought back to my mind a little tool I built in the 1990s for manipulating text strings. The idea was to combine a template and a data list.
The template consisted of plain text with embedded formal parameters. The data list consisted of a series of lines of text, where each line contained actual parameters. The expansion tool would read each line of the data list and, for that line, produce an expansion of the template, with actual parameters substituted for formal parameters. It's a little like the mail-merge facility in a word processor.
The tool I built was not terribly efficient, but I could use it in an amazing variety of ways. One way was to use a query on the metadata of a relational database to generate a list of a few hundred user table names. Then generate a template with some SQL DDL to be done on each table, with the table name as a formal parameter. The expansion was ready to feed into the SQL interpreter. As long as I kept the number of entries in the data list down to a few hundred, the inefficiency never bothered me.
Why did I bother to build my own tool, instead of using available tools? Well, you have to understand "production machines" of that era. They often did not have any compilers on them. Intentionally, so as to prevent any development work. The machines I worked on were all VAXen. But they all had SQL, in order to be able to manage the database. And they all had DCL, in order to be able to command VMS. So I wrote it in DCL.