Text this: Regulated Rewriting in Formal Language Theory