About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/str_quote_string.tm.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 str_quote_string Context: slangrtl

Synopsis

Escape characters in a string.

Syntax

String_Type str_quote_string(String_Type str, String_Type qlis,
Integer_Type quote)

Description

The str_quote_string returns a string identical to str except that all characters in the set specified by the string qlis are escaped with the quote character, including the quote character itself. This function is useful for making a string that can be used in a regular expression.

Example

Execution of the statements

   node = "Is it [the coat] really worth $100?";
   tag = str_quote_string (node, "\\^$[]*.+?", '\\');

will result in tag having the value:

    Is it \[the coat\] really worth \$100\?
Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.