in reply to Try this in Regexp palindrome

This code has to performed only in regular expression...

Sorry, but put like that it really sounds like homework....
Why the restriction?