Package: pcregrep
Version: 7.8-3
Severity: normal

I'm a Perl grep novice.  This might be a program bug, a manual bug,
or merely user confusion:

    # as hoped for
    seq 10 | pcregrep -M '2\n3'
    2
    3

    # why does '1' match?
    seq 10 | pcregrep -M '(*CR)2.3'
    1
    2
    3

    # why don't these match anything?
    seq 10 | pcregrep -M '(*ANY)2.3' ; echo  error=$?
    error=1
    seq 10 | pcregrep -M '(*ANYCRLF)2.3' ; echo  error=$?
    error=1

The patterns '(*CR)2.3', '(*ANY)2.3' and '(*ANYCRLF)2.3' were inspired by:

    man pcrepattern | grep -n -A 8 'a newline convention'
    43:       It is also possible to specify a newline convention by starting a 
pattern string with one of
    44-       the following five sequences:
    45-
    46-         (*CR)        carriage return
    47-         (*LF)        linefeed
    48-         (*CRLF)      carriage return, followed by linefeed
    49-         (*ANYCRLF)   any of the three above
    50-         (*ANY)       all Unicode newline sequences
    51-

If both the quoted outputs and 'man pcrepattern' are correct, perhaps
the 'pcregrep' man page should include some good examples showing how
patterns with newlines behave.

Hope this helps...



-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.30-1-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash

Versions of packages pcregrep depends on:
ii  libc6                         2.9-27     GNU C Library: Shared libraries
ii  libpcre3                      7.8-3      Perl 5 Compatible Regular Expressi

pcregrep recommends no packages.

pcregrep suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to