RosettaCodeData/Task/Palindrome-detection/Java/palindrome-detection-4.java

4 lines
123 B
Java
Raw Permalink Normal View History

2014-01-17 05:32:22 +00:00
public static boolean pali(String testMe){
return testMe.matches("|(?:(.)(?<=(?=^.*?(\\1\\2?)$).*))+(?<=(?=^\\2$).*)");
}