TPIPE matching problem

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Jun 4, 2008
19
0
#1
I have a text file:
1058 No white space at start of line
bbbb1058 white space at start of line

Note: the bbbb in the above line represents blanks

I issue the command:
tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,^1058

and get

1 1058 No white space at start of line
2 bbbb1058 white space at start of line

Next do the command:
perl.exe -e "while (<STDIN>) {print $_ if m/^1058/"} <test.txt

and get:

1058 No white space at start of line

The second line does not get printed. It looks like tpipe is not handling the start of line matching character (^) the same way as perl does.

I am using ActiveState Perl:
This is perl 5, version 16, subversion 2 (v5.16.2) built for MSWin32-x64-multi-thread

TCC version is
TCC 15.01.52 x64 Windows 7 [Version 6.1.7601]

Is this considered a bug?

David McClelland
 
#2
The TCC escape character '^' is not protected in this command as it is in the Perl command.
Code:
tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,^1058
Either double the '^' or quote the regex.
Code:
v:\> type test.txt
1058 No white space at start of line
  1058 white space at start of line

v:\> tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,^1058
1 1058 No white space at start of line
2  1058 white space at start of line

v:\> tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,^^1058
1 1058 No white space at start of line

v:\> tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,"^1058"
1 1058 No white space at start of line
 
Jun 4, 2008
19
0
#3
The TCC escape character '^' is not protected in this command as it is in the Perl command.
Code:
tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,^1058
Either double the '^' or quote the regex.
Code:
v:\> type test.txt
1058 No white space at start of line
  1058 white space at start of line

v:\> tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,^1058
1 1058 No white space at start of line
2  1058 white space at start of line

v:\> tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,^^1058
1 1058 No white space at start of line

v:\> tpipe /input=test.txt /grep=3,1,0,0,0,0,0,0,"^1058"
1 1058 No white space at start of line