HI All,
I’ve been using the basic split for a while – where I just parse out a string into an array based on a simple token like ” ” or “,”.
So of course a customer tries this: \\.br\ which fails miserably.
I need to parse to an array of lines. The string for example looks like this:
"LINE 1\\.br\\LINE 2\\.br\\LINE 3\\.br\\LINE 4\\.br\\"
and this fails with java.util.regex.PatternSyntaxException: Unexpected internal error.
Any ideas?
Don’t forget String.split takes a Regex, and most people put in a string literal, so you have to escape the \ for regex and escape it for strings, so you end up with “\\\” in your String argument to represent a single \ character.
e.g.
so in your case: