Showing posts with label palindrome regular expression. Show all posts
Showing posts with label palindrome regular expression. Show all posts
Palindrome regular expression
Posted by Raj
Palindrome regular expression
A palindrome is a word that is same from front to back and back to front. e.g. Noon
Search for two identical letters, use "\([a-z]\)\1".
The regular expression to match a 5 letter palindrome:
\([a-z]\)\([a-z]\)[a-z]\2\1
A palindrome is a word that is same from front to back and back to front. e.g. Noon
Search for two identical letters, use "\([a-z]\)\1".
The regular expression to match a 5 letter palindrome:
\([a-z]\)\([a-z]\)[a-z]\2\1