fork download
  1. import java.util.*;
  2. import java.util.regex.*;
  3. import java.lang.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. String currentLine = "BROWSER=FireFox";
  10. System.out.println("Current Line: "+ currentLine);
  11. Pattern p = Pattern.compile("(.*?)=(.*)");
  12. Matcher m = p.matcher(currentLine);
  13. if (m.find()) {
  14. System.out.println("Key: "+m.group(1)+" Value: "+m.group(2));
  15. }
  16. }
  17. }
Success #stdin #stdout 0.07s 380224KB
stdin
Standard input is empty
stdout
Current Line: BROWSER=FireFox
Key: BROWSER Value: FireFox