RE: Expression using backslash?

"Dave Bender" <[email protected]> Tue, 15 Apr 2003 16:58:37 -0500
Newsgroups gmane.comp.jakarta.regexp.user
Message-ID <[email protected]>
I thought that to find a backslash, RE needed four backslashes.  Not sure
what's happening inside, but that's what worked for me to finding the
backslash.

Dave


-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Tuesday, April 15, 2003 4:30 PM
To: [email protected]
Subject: Expression using backslash?


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]