Hi all:

I am running SEC 2.5.2 on Windows XP under cygwin 1.7 with perl
revision 5 version 10 subversion 0 patch 34065 and I have another
little conundrum with SEC.

Using the following ruleset:

# see what $1, $2, $3 evaluate to
type = pair
desc = subpattern test
ptype= regexp
desc2 = test subpattern
pattern = test ([0-9]) ([0-9]) ([0-9])
action = write - "$1, $2, $3, %1, %2, %3"; write - "dollar0: $0"; write - 
"pct0: %0"
ptype2 = regexp
pattern2 = test $2
action2 = write - "%1, %2, %3, $1, $2, $3"; write - "dollar0: $0"; write - 
"pct0: %0"

with the input:

  test 7 8 9
  test 8

I expect to see:

  Writing event '"7, 8, 9, %1, %2, %3"' to file -
  "7, 8, 9, %1, %2, %3"
  Writing event '"dollar0: test 7 8 9"' to file -
  "dollar0: test 7 8 9"
  Writing event '"pct0: %0"' to file -
  "pct0: %0"
  test 8
  Writing event '"7, 8, 9, $1, $2, $3"' to file -
  "7, 8, 9, $1, $2, $3"
  Writing event '"dollar0: test 8"' to file -
  "dollar0: test 8"
  Writing event '"pct0: test 7 8 9"' to file -
  "pct0: test 7 8 9"

but I actually see:

  Writing event '"7, 8, 9, %1, %2, %3"' to file -
  "7, 8, 9, %1, %2, %3"
  Writing event '"dollar0: test 7 8 9"' to file -
  "dollar0: test 7 8 9"
  Writing event '"pct0: %0"' to file -
  "pct0: %0"
  test 8
  Writing event '"7, 8, 9, 1, $2, $3"' to file -
  "7, 8, 9, 1, $2, $3"
            ^ huh???
  Writing event '"dollar0: test 8"' to file -
  "dollar0: test 8"
  Writing event '"pct0: test 7 8 9"' to file -
  "pct0: test 7 8 9"

Why is $1 being replaced with 1 in the output? IIRC all the $n
variables should be undefined if pattern2 doesn't have any
subpatterns.  Also $1 should never have the value of 1 in my senario.

So what command line parameter am I missing this time 8-)?
Maybe -dont_play_games_with_john_he_has_only_had_1_coffee.

If I change pattern2 to capture a subpattern, the captured subpattern
is properly displayed for $1.

Can anybody duplicate this on another platform?

Thanks.

--
                                -- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Simple-evcorr-users mailing list
Simple-evcorr-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to