I have 3 values IU, PRI and RET. if my input string contains any one or more value(s),
the Java regular expression should return true.
I don't know if you are still looking for the solution of this. But here's the code for your question. I assumed that the anagrams you are looking for are separated by spaces and the words appear in Uppercase.
String text = "put returns UI between IU paragraphs PRI RIP and RET ETR";
Pattern p = Pattern.compile("([UI]{2}|[PRI]{3}|[RET]{3})");
Matcher m = p.matcher(text);
System.out.println(m.find());
If you are try for case insensitive matching, change the pattern to the following;
(?i)([UI]{2}|[PRI]{3}|[RET]{3})