Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Would something like the Levenshtein edit distance assist you (the greater the value, the greater the two strings' distance)?

use strict; use warnings; use Text::LevenshteinXS qw(distance); my @var; $var[0] = "Gallia est omnis divisa in partes tres"; $var[1] = "Gallia est omnis divisa in ..."; $var[2] = "Gallia est omnis ..."; $var[3] = "Gallia"; $var[4] = "... omnis divisa in ..."; $var[5] = "Gallia est ... tres"; $var[6] = "Gallia ... partes tres"; $var[7] = "Gallia est ... partes tres"; $var[8] = "Gallia ... divisa ... tres"; $var[9] = "... tres"; $var[10] = "quattuor"; print qq{Each string's 'distance' from "$var[0]":\n\n}; for ( 0 .. $#var ) { print distance( $var[0], $var[$_] ) . " - $var[$_]\n"; }


Each string's 'distance' from "Gallia est omnis divisa in partes tres" +: 0 - Gallia est omnis divisa in partes tres 11 - Gallia est omnis divisa in ... 21 - Gallia est omnis ... 32 - Gallia 21 - ... omnis divisa in ... 22 - Gallia est ... tres 19 - Gallia ... partes tres 15 - Gallia est ... partes tres 18 - Gallia ... divisa ... tres 33 - ... tres 34 - quattuor

In reply to Re: Using special characters in left part of a regex match? by Kenosis
in thread Using special characters in left part of a regex match? by shamat

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (3)
    As of 2018-01-18 12:53 GMT
    Find Nodes?
      Voting Booth?
      How did you see in the new year?

      Results (211 votes). Check out past polls.