The Rx language is a text transformation script language with a regular expressions support. A script in the Rx language is a sequence of commands (such as [REPLACE statement], [REPLICATE statement], [PREFIX statement], etc.), separated by line breaks, one after another applied to the text being processed. Each command consists of an statement name and a list of space-separated arguments. The arguments can include string or numeric parameters, as well as reserved words determined by the syntax of each specific statement. Statement names and reserved words are case insensitive; the case sensitivity of string arguments can be controlled using prefixes (see [Rx strings]).
The scope of each command can be either the entire text or its parts (see [Context areas]).
Also you can use comments in C++ style (two slashes).
An example of a simple script in the Rx language:
REPLACE P"mad" TO P"Mad" // Bring the first letter in the word "mad" to the upper case
REPLACE P"world" TO P"World" // Do the same with the word "world"
REPLICATE p"Mad" 4 TIMES // Repeat the word "Mad" 4 times
REPLACE P"Mad Mad" TO P"Mad, Mad" // Insert a comma between the repetitions of the word "Mad"
SUFFIX P"!" // Adding an exclamation
If you apply this to the line "It's a mad world" you get the title of a famous movie from the past: "It's a Mad, Mad, Mad, Mad World!"
Wiki: COPYPASTE statement
Wiki: Context areas
Wiki: Home
Wiki: PREFIX statement
Wiki: REPLACE statement
Wiki: REPLICATE statement
Wiki: Removing a substring
Wiki: Rx strings
Wiki: SUFFIX statement