<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172429</link>
    <title>MATLAB Central Newsreader - find near palindromes with regexp?</title>
    <description>Feed for thread: find near palindromes with regexp?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sat, 12 Jul 2008 00:26:03 -0400</pubDate>
      <title>find near palindromes with regexp?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/172429#442596</link>
      <author>jay vaughan</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I am trying to find palindromes and near palindromes within&lt;br&gt;
text strings using regular expressions. I used a regexp from&lt;br&gt;
the Matlab help to get &lt;br&gt;
&lt;br&gt;
test = 'aaaaCDEFGGFEDCbbbbbJKLMNOaabbONMLKJaaaa';&lt;br&gt;
P = regexp(test,'(.{3,13}).?(??@fliplr($1))','match');&lt;br&gt;
&lt;br&gt;
which correctly gives P = 'CDEFGGFEDC'.&lt;br&gt;
&lt;br&gt;
I would also like to be able to find the near palindrome&lt;br&gt;
starting with JKL. By near palindrome I mean something like&lt;br&gt;
JKLMNOaabbONMLKJ where the aabb part may be two or more&lt;br&gt;
nonpalindromic characters. Unfortunately, I think my regular&lt;br&gt;
expression Kung Fu is too weak to see how to do that. Anyone&lt;br&gt;
out there know a simple way to do this?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
J</description>
    </item>
  </channel>
</rss>

