DavidKroukamp
Practically a Master Poster
693 posts since Dec 2011
Reputation Points: 282
Solved Threads: 169
Then could you post your code so we may see how you did it
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
like what I said my last post
Then could you post your code so we may see how you did it
we'll find out whats wrong if youpost your code
| and : have it's own special character like endline
not really I was able to pull it off without a special character
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
The regex is [.:|] (ie any of the three chars in the []) EXCEPT that . and | are special chars in regex and need to be escaped with a \ to indicate that you want to use them literally, ie [\.:\|]
Next problem is that \ is a special character in Java string literals, and needs to be escaped with an extra \ you want to use it literally. This means that the Java string you need is "[\\.:\\|]"
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
and what do each those println show?
Edit: Anyway I think JamesCherrill's reply might suit best for your needs, you should have said that you were reading a file in the first post so I could have posted a more concise reply :)
zeroliken
Veteran Poster
1,106 posts since Nov 2011
Reputation Points: 201
Solved Threads: 162
Please mark this "solved" for the archives. Thanks.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073