You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Nestor Urquiza <ne...@yahoo.com> on 2006/05/26 14:49:23 UTC

[jexl] How to escape the Apostrophe

Hello guys,
I need to have a string resulting from the expression 
"foo's brother" + " is bar"

However the software I am using is expecting the
concatenation to use single quotes like:

'foo's brother' + ' is bar'

Of course the above is invalid and I cannot come up
with a solution for escaping. I have tested:

'foo\'s brother' + ' is bar'
and
'foo\\'s brother' + ' is bar'

But they are invalid as well. Can I escape the
apostrophe?

What are the possible solutions for it?
Thanks! 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [jexl] How to escape the Apostrophe

Posted by Dion Gillard <di...@gmail.com>.
Jexl doesn't have a way of escaping quotes as such.

All Strings in Jexl are either single quoted or double quoted, no mixing of
the two.

Is there no way you could replace the first and last single quotes with
doubles?

On 5/26/06, Nestor Urquiza <ne...@yahoo.com> wrote:
>
> Hello guys,
> I need to have a string resulting from the expression
> "foo's brother" + " is bar"
>
> However the software I am using is expecting the
> concatenation to use single quotes like:
>
> 'foo's brother' + ' is bar'
>
> Of course the above is invalid and I cannot come up
> with a solution for escaping. I have tested:
>
> 'foo\'s brother' + ' is bar'
> and
> 'foo\\'s brother' + ' is bar'
>
> But they are invalid as well. Can I escape the
> apostrophe?
>
> What are the possible solutions for it?
> Thanks!
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>


-- 
http://www.multitask.com.au/people/dion/
Chuck Norris sleeps with a night light. Not because Chuck Norris is afraid
of the dark, but because the dark is afraid of Chuck Norris