fork download
  1. import java.util.*;
  2. import java.util.regex.*;
  3.  
  4. class Ideone
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. String[] RESERVED_WORDS = { "id", "url" };
  9. String[] result = {"id report with report-id is in the url but not in the identifier (id)"};
  10. Arrays.stream(RESERVED_WORDS).forEach(word -> result[0] = result[0].replaceAll("(?i)(?<![\\w-])" + Pattern.quote(word) + "(?![\\w-])", word.toUpperCase()));
  11. System.out.println(result[0]);
  12.  
  13. }
  14. }
Success #stdin #stdout 0.11s 51008KB
stdin
Standard input is empty
stdout
ID report with report-id is in the URL but not in the identifier (ID)