fork download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. String s1 = "abc%26def";
  9. String s2 = "abc%2623def";
  10. String regex = "%26(?!\\d)";
  11. System.out.println(s1.replaceAll(regex, "&"));
  12. System.out.println(s2.replaceAll(regex, "&"));
  13. }
  14. }
Success #stdin #stdout 0.02s 245632KB
stdin
Standard input is empty
stdout
abc&def
abc%2623def