in reply to Re: Regex Help
in thread Regex Help

Thanks for the response L~R, Yes, this is Win32. I tried:
print if /ATDT\d+.BUSY/s; print if /ATDT\d+.*BUSY/s; print if /ATDT\d+\r\nBUSY/m;
and I'm still not matching. Something that I didn't mention in the first post, that I didn't feel was relevant, but maybe it is. In this file, each line ends with a ^M character (I forget what these are called, form feeds?), but when I print out the entire file in a while loop, they do not appear, so I figured they did not effect the regex or do they? If they did, then this one should still work print if /ATDT\d+.*BUSY/s; right?

Replies are listed 'Best First'.
Re^3: Regex Help
by Limbic~Region (Chancellor) on Jun 07, 2004 at 15:04 UTC
    Dru,
    I am surprised that /ATDT\d+.*BUSY/s does not work. I would suggest an octal dump and since you are on Win32, you might need Perl Power Tools. It will show you what you can't see ;-)

    Cheers - L~R

      Or use perl itself for a rudimentary dump of the stream:
      echo "ATDT123456 \r\nBUSY" | perl -e 'local $/=undef;@chars=split //, +<STDIN>; for(@chars) {print $_ . " " . ord($_) . "\n"; }'