Double quotes are interpreted as literals in regex; they are not special characters. You are trying to match a literal "||"
.
Just use Pattern.quote(delimiter)
:
As requested, here's a line of code (same as Sanjay's)
final String[] tokens = line.split(Pattern.quote(delimiter));
If that doesn't work, you're not passing in the correct delimiter.