Well, you didn't include the two results you were getting and which one you though is correct. It always helps if you tell us what you get, we're not omniscient.

Anyway, I refuse to believe this is a OS issue. But what I do believe is that's Perl version issue. Given that the code is in the file x.pl:

$ /opt/perl/5.8.0/bin/perl x.pl <<< HTML1 >>> <<< CODE1 >>> <<< HTML2 >>> <<< CODE2 >>> <<< HTML3 >>> $ /opt/perl/5.6.1/bin/perl x.pl <<< HTML1 >>> <<< CODE1 >>> <<< HTML3 >>> $ /opt/perl/5.6.0/bin/perl x.pl <<< HTML1 >>> <<< CODE1 >>> <<< HTML2 >>> <<< CODE2 >>> <<< HTML3 >>> $ /opt/perl/5.005_03/bin/perl x.pl <<< HTML1 >>> <<< CODE1 >>> <<< HTML2 >>> <<< CODE2 >>> <<< HTML3 >>>

So, it's my guess that the Linux box you tried this on has perl 5.6.1 installed, and the Windows box has either a later or an older version of Perl installed.

Abigail


In reply to Re: REGEX different on Linux & Win32! by Abigail-II
in thread REGEX different on Linux & Win32! by gmpassos

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.