chaos_cat,

Thank you very much for taking time to "play" with my problem and also for the patience with my incomplete requirements.

Some clarifications:
- the new words will not modify the position in the string of the words that follow (this is true for the original string as well as for the modified string).

e.g.
----

original: Perlmonks is ..................... the best [perl] ...................[community]
modified: Perlmonks is <one> <of> the best [community] <of> [perl] <users>

Note: "the" is the 3rd word in the original and it is considered to be the 3rd word in the modified string also because "<one>" and "<of>" are new words and should be ignored (will not increase the position value)

while

original: ..... the best [perl] ....................[community]
modified: ... the best [community] <of> [perl] <users>

Note: "perl" and "community" should be marked as changed/moved, because they changed the position in the sentence.

words ranks:
------------
original: ......1.......2....................3....4.....[5].............[6]...........
modified: ....1.......2..<7>..<8>...3....4.....[6]...<9>...[5]......<10>.

Please let me know if you don't understant what I tried to explain above and I will explain it in different words.

Thanks a lot.


In reply to Re^2: diff of two strings by flaviusm
in thread diff of two strings by flaviusm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.