Is string matching and replacement considered in formal languages? Is string matching and replacement, as an operation on strings or on formal languages, considered in  formal languages?


For example, the family of regular languages, or the family of
context free languages, ..., are closed under certain string
operations.

I would wonder if these families or some others may be closed under
string matching and replacement?
Are string matching and replacement equivalent to some combination
of other string operations?
Or is matching and replacement considered in formal languages in
some other ways?


Thanks and regards!
Match &amp; replace is a special case of rational transduction, a quite powerful class of string mappings with a number of nice properties.

The classes of regular, context-free and recursive enumerable languages are all closed against rational transduction (source), so this carries over to match &amp; replace.

It does not seem as if the necessary elementary operations had a representation in formal language theory.