I am doing this python, but I would like you advice on it.<br><br>I am given a list like:<br><div style="margin-left: 40px; font-family: courier new,monospace;">1: JCT BOX JS27 T 88-F-1<br>2: JCT BOX JS-2713 EE-15.2<br>3: JCT BOX JS32 H 116 A C 14.5<br>
4: JCT BOX JS28 T 120-N-11<br>5: JCT BOX JS28 T-120-N-11<br>6: JCT BOX JS32 H 116 A C-14.5<br>7: JUNCTION BOX JS32 H 116 A C-14.5<br></div><div style="font-family: courier new,monospace;"><font face="arial,helvetica,sans-serif">and i need to find &quot;similar&quot; items, i have already written the part of my script to find the similar items, for example, line 4 and 5 are similar. i used a simple Regular Expression that was generated after each line.<br>
<br>so say you line was:<br>ASD 123<br>the regex would be<br>A[!-/\s]?S[!-/\s]?D[!-/\s]?1[!-/\s]?2[!-/\s]?3[!-/\s]?<br>this finds anything that may be similar due to punctuation.<br><br>the next step is to find lines that are similar based on abbreviations, so I would be able to match lines with JUNCTION and JCT, then check the results from that match against the results from the first match and find the most likely candidates for similarities.  I have tried this:<br>
<br></font><font face="arial,helvetica,sans-serif">use a regular expression built from the letters in an abbreviation, eg, JCT would look like J.*[C]?.*[T]? so that the expression would find anything that had those letters in it in that order, with anything in between, but that does not work, any ideas?<br>
<br></font></div>-- <br>David Zmick<br>/dz0004455\<br><a href="http://david-zmick.co.cc">http://david-zmick.co.cc</a><br>