Skip to content

Instantly share code, notes, and snippets.

@jryebread
Created December 7, 2017 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jryebread/9a3300ef3778929761ae8d4383a7291b to your computer and use it in GitHub Desktop.
Save jryebread/9a3300ef3778929761ae8d4383a7291b to your computer and use it in GitHub Desktop.
public static boolean isPalindrome(String str) {
Pattern pattern = Pattern.compile("\\([a-z]\\)\\([a-z]\\)[a-z]\\2\\1");
Matcher matcher = pattern.matcher(str);
if(matcher.find())
return true;
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment