Question Warriors Question Warriors - 2 years ago 104
Java Question

Conditionally splitting a string on a complex delimiter

I have string


I want output like this :



How can i achieve this using java
i mean to split with "," but "," which is after "|"

Answer Source

Add a positive lookbehind condition, for example:


Lookbehind condition (?<=\\|\\d{1,10}) means: | followed by up to 10 digits (as lookbehind requires defined maximum length, unbounded repetition modifiers as + or * cannot be used).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download