A -> Bwhere A and B are any regular expressions that define simple regular languages. We define this replacement expression as
[no_A [A .x. B]]* no_A]where no_A abbreviates ~$[A - []], i.e. the complement of any string that includes A minus the empty string. Note that if A does not contain the empty string, then
~$[A - []] = ~$[A]On the other hand, if A does contain the empty string, ~$[A] is null whereas ~S[A - []] at least contains the empty string. We need the latter language in our definition to get the intended meaning for A -> B The definition of -> describes a regular relation whose members contain zero or more iterations of [A .x. B], possibly alternating with strings not containing A that are mapped to themselves.