You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-user@jakarta.apache.org by "Daniel F. Savarese" <df...@savarese.org> on 2003/03/15 05:21:11 UTC

Re: Escaping pipe symbols

In message <51...@uswpmx06.merck.com>, "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: oro-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: oro-user-help@jakarta.apache.org