fork(1) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.regex.Matcher;
  5. import java.util.regex.Pattern;
  6.  
  7. class Ideone
  8. {
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. String s = "x= 2-3 y=3 z= this, that";
  12. String regex = "(?<=[^\\h=,]=\\h{0,100}[^\\h=,]{1,100})\\h+";
  13. String parts[] = s.split(regex);
  14.  
  15. for (String part : parts)
  16. System.out.println(part);
  17.  
  18. }
  19. }
Success #stdin #stdout 0.08s 34024KB
stdin
Standard input is empty
stdout
x=   2-3
y=3
z=   this,   that