Re: Expression using backslash?

Raphael Michel <[email protected]> 15 Apr 2003 23:41:08 +0200
Newsgroups gmane.comp.jakarta.regexp.user
Message-ID <1050442867.3182.11.camel@bax>
Have you tried with :

String blah  = "This\/is\/a\/test";
RE regexp = new RE("\\/");

or with 

String blah  = "This\\/is\\/a\\/test";
RE regexp = new RE("\\\\/");

??




-- 
Raphael Michel <[email protected]>

Le mar 15/04/2003 à 23:29, [email protected] a écrit :
> I'm having some issues attempting to split on a regular expression that 
> contains a backslash.  Here is an example (I want to split on "\/" - an actual 
> backslash then forwardslash)..
> 
> String blah  = "This\\/is\\/a\\/test";
> RE regexp = new RE("\\/");
> String[] temp = regexp.split(blah);
> 
> If you look at the resulting string array you'll see this:
> 
> This\
> is\
> a\
> test
> 
> Now why are the backslashes in there?  I thought when you ran a split it was 
> support to remove all regexp chars?
> 
> Thanks,
> 
> - Brent
> 
> -------------------------------------------------
> Get your very own filtered email account!
> http://www.columbia.sc
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]