prefix{kernel}suffix|old|new|
The kernel string can be a single element, or can be a full group expression. Processing of the element proceeds as follows:
). If no substitutions are to be performed then the old
and new strings, together with the three separator characters, should be
omitted.
The names which result from this processing are then added to a group. If there is no ambiguity about where the kernel starts and finishes (for instance if the prefix and suffix are both omitted, and the kernel consists of a single element) then the kernel does not need to be enclosed within kernel delimiters. The contents of the kernel can be any group expression. In particular, the kernel can contain other nested kernels with their own associated editing strings.
Let's look at some examples:
A_{TOM,DICK,HARRY}_B
This will give rise to the three names A_TOM_B, A_DICK_B and A_HARRY_B.
^FILE.LIS|_OLD|_NEW|
This will read names from the text file FILE.LIS (see the description of indirection elements below), and replace all occurrences of the string ``_OLD'' within the names with the string ``_NEW''.
WW,{A,B_{ONE,TWO,THREE}|T|Z|,C}KK|_Z|_Y|
This is a complex example and needs looking at carefully. Looking at it at the highest level, it can be thought of as:
WW,{kernel}KK|_Z|_Y|
where kernel is the group expression:
A,B_{ONE,TWO,THREE}|T|Z|,C
The first and third elements in this inner group expression are simple literal names and give rise to the two names A and C. The second element specifies that the three names ONE, TWO and THREE are to be edited by replacement of the letter T by the letter Z, and the addition of the prefix B_. After editing, these three names become B_ONE, B_ZWO and B_ZHREE. So the total group specified by this inner kernel is:
A
B_ONE
B_ZWO
B_ZHREE
C
We can now go back and look at the full group expression in the form:
WW,{kernel}KK|_Z|_Y|
The first element specifies the single name WW. The second element specifies that each of the names arising from the expansion of the inner kernel (i.e. the names listed above) should be edited by replacing _Z with _Y, and then appending the suffix KK. Thus the final group contains:
WW
AKK
B_ONEKK
B_YWOKK
B_YHREEKK
CKK
GRP Routines for Managing Groups of Objects