Regex to match any kind of Palindrome, Does Any one have an Idea :_)

How to create a regex pattern to identify words which contain palindromes or the whole word itself is a palindrome such as “programmatic” , “malayalam:sweat_smile:

2 Likes

@supermanPunch
You can use the following: (?<N>.)+.?(?<-N>\k<N>)+(?(N)(?!))
Keep in mind that this will match " a " or " I " so you may want to trim and filter your matches by some specified length.