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 2001/08/05 22:30:55 UTC

Re: s|/|\|g

In message <81...@webmail.xs4all.nl>, jdijkmei@
xs4all.nl writes:
>valid in perl56 I found out. So I changed the sharp to the pipe 
>having "s|/|\\|g" which should be valid in perl56 but somehow didn't get 
>through the parser: it simply didn't match. I changed the escaped backslash 
>\\ to a double escaped backslash \\\\ and everything worked fine again.
>But this looks like a bug to me, because perl56 does accept "s|/|\|g" am I 

The double escaped backslash \\\\ is necessary because the backslashes
are interpreted at compile-time by the Java compiler.  s|/|\|g would
be s|/|\\|g in Java, but s|/|\|g is not a valid Perl substitution because
you're escaping the last |.  You'd want s|/|\\|g in Perl, which would be
s|/|\\\\|g in Java.  It wasn't clear to me in your followup message if
you figured it out, so I figured I'd reply anyway.

daniel