commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: [Jexl] String Literals with Newline do not work
Date Fri, 06 Jul 2007 17:19:20 GMT
On 06/07/07, Christoph Gaffga <cgaffga@triplemind.com> wrote:
> hi,
>
> thanks for your quick reply.
>
> > Try
> > e = ExpressionFactory.createExpression("foo.bar.indexOf('"\n'")");
>
> now I got a syntax error, do you mean:
> e = ExpressionFactory.createExpression("foo.bar.indexOf('\"\n'\")");

Sorry, yes, I was thinking of another language.

Try using a variable instead:

jc.getVars().put("nl","\n");
e = ExpressionFactory.createExpression("foo.bar.indexOf(nl)");

>
> I tried some variations, still the same exception.
>
> regards,
> Christoph
>
>
> sebb wrote:
> >> I have some problems to use Jexl expressions to look for special
> >> characters in strings, like newline or tabs:
> >>
> >>  e = ExpressionFactory.createExpression("foo.bar.indexOf('\n')");
> >
> > Does not look valid syntax.
> >
> > Try
> >
> > e = ExpressionFactory.createExpression("foo.bar.indexOf('"\n'")");
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>

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


Mime
View raw message