next up previous 204
Next: The Order of Names Within a Group
Up: Group Expressions
Previous: Comments Within Group Expressions

Escaping the Special Characters in a Group Expression

If is possible to specify that a given character be used as an ``escape character'' within group expressions. This facility is normally suppressed, but an application can choose to switch it on by assigning a value to the ESCAPE control character associated with a group (see section [*]). If this is done, any special meaning associated with a character within a group expression is ignored if the character is preceeded by an escape character. The escape characters themselves are not included in the resulting names if they preceed any of the other ``special'' control characters. Note, escape characters which do not preceed another control character are included in the resulting names.

For instance, the group expression:

      * | A

would normally result in an error because the ``|'' character would be taken as the start of an incomplete specification for some editing to apply to the preceeding text (assuming the application has not changed the default editing behaviour). If, in fact, the user wants this string to be accepted as a literal string (maybe representing a Unix piping operation for instance), then the ``|'' should be escaped. Assuming the application chooses to use the backslash character ``\'' as the escape character, then this can be done by entering the following group expression:

      * \| A

The ``\'' character results in the ``|'' character being treated as part of the required string, rather than as the start of an editing specification. The string returned to the application is then ``* | A'' (note, the escape character has been removed). Any escape characters which do not preceed special characters are included literaly in the returned string. So, for instance, if the group expression was:

      \* \| A

the string ``\* | A'' would be returned to the application.

All escape characters within a section of a group expression can be ignored by using the special strings ``


next up previous 204
Next: The Order of Names Within a Group
Up: Group Expressions
Previous: Comments Within Group Expressions

GRP Routines for Managing Groups of Objects
Starlink User Note 150
D.S. Berry
21st October 2009
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council