[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] escape quotation marks in regular expression
Dear list,
I am receiving strings that may or may not be wrapped in double quotation marks. I would like to remove the quotation marks at the start and end of the string, if there are. There may also be quotation marks in the middle of the string, which should not be removed. I thought to use the replace() function for this, like so: B B B select="replace(., '^\"?(.+)\"?$', '$1')" But Saxon throws the following error: B B B FORX0002: Syntax error at char 3 in regular expression: Escape character '"' not allowed So what do I have to put instead of "\""? That is, what is the correct way to escape the quotation marks in the regular expression? (I am aware that I could do this without a regular expression, i.e., with substring() and string-length(), but I would like to know how to do it with replace() since that seems simpler.) Thanks in advance for your help! Wolfhart
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|