### comment on

 Need Help??
```sub compatible {
my (\$s1, \$s2) = @_;
my \$m = length(\$s1) - 1;
(\$s1 . \$s2) !~ /^.{0,\$m}?([^_]).{\$m}(?!\1)[^_]/;
}

printf "%s v %s ? %s\n", @\$_, compatible( @\$_ ) ? 1 : 0
for [ qw[ _8__3__19 48____7__ ] ],  # compat
[ qw[ _8__3__19 4_8___7__ ] ],  # compat
[ qw[ _8__3__19 48_____7_ ] ];  # clash

Update:And this is wrong too.

Update:

```sub compatible {
my (\$s1, \$s2) = @_;
my \$m = length(\$s1) - 1;
my(\$n, \$p) = (\$m - 1, \$m + 1);
(\$s1 . \$s2) !~ /^.{0,\$m}?([^_]).{\$m}(?!\1)[^_]/ and
(\$s1 . \$s2) !~ /^.{0,\$m}?([^_])(?:.{0,\$n}|.{\$p,})\1/;
}

printf "%s v %s ? %s\n", @\$_, compatible( @\$_ ) ? 1 : 0
for [ qw[ _8__3__19 48____7__ ] ],  # compat
[ qw[ _8__3__19 4_8___7__ ] ],  # clash
[ qw[ __8_3__19 48____7__ ] ],  # clash
[ qw[ __8_3__19 84____7__ ] ],  # clash
[ qw[ _8__3__19 48_____7_ ] ];  # clash

In reply to Re: Comparison by position and value by ambrus
in thread Comparison by position and value by BrowserUk

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, 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: & & < < > > [ [ ] ]
• Link using PerlMonks shortcuts! What shortcuts can I use for linking?
• See Writeup Formatting Tips and other pages linked from there for more info.

Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2020-05-31 03:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
If programming languages were movie genres, Perl would be:

Results (173 votes). Check out past polls.

Notices?