RE: Escaping pipe symbols
"Sharpe, Cassandra" <[email protected]> Mon, 17 Mar 2003 15:34:24 -0500
| Newsgroups | gmane.comp.jakarta.oro.user |
|---|---|
| Message-ID | <[email protected]> |
Your interpretation of my question was correct. It was just wishful thinking on my part that you could somehow use some special character or something to get the scenario that I was describing to work. I figured out as much by looking through the source code. Thank you anyway for the response. -Cassandra -----Original Message----- From: Daniel F. Savarese [mailto:[email protected]] Sent: Friday, March 14, 2003 11:21 PM To: ORO Users List Subject: Re: Escaping pipe symbols In message <[email protected]>, "Shar pe, Cassandra" writes: >Now the text that I need to split has pipe symbols embedded within it. For >example that text is ... "Word A" |" Word B"| "Word| C". Is there a way to >escape the pipe symbol embedded within the word? I don't understand the question. If you're trying to split a string based on a delimiting pattern, you don't have to do anything special to the input string. If the input string you are splitting contains occurrences of the delimiting pattern that you don't want to treat as a delimiter, then you just have to come up with a pattern that more accurately reflects your splitting criteria. If the case is sufficiently complex that it cannot be handled by a single pattern, then you can't use split and have to write a lexer (i.e., tokenizer) and extract the tokens with some extra code. A while loop with a couple of pattern matching tests will do the trick. daniel --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] ------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it. ==============================================================================