Feature request: grep hex strings with -e

Markku Parviainen maketsi at gmail.com
Fri Oct 5 02:04:43 EDT 2012


2012/10/4 Carter Bullard <carter at qosient.com>:
> ra* clients use the available regular expression library, and should support hexadecimal codes for matching now.
> So, there is nothing keeping ra* from doing hexidecimal code matching.  Because you have to use '\xNN' to specify the
> codes, when you provide it on the command line, you may need to escape the ' \ ' to get it past the shell.

The param was already quoted so that the shell (bash) would not interfere.
Anyway, for some reason it just doesn't work. I attached a sample (240
bytes) for your analysis.

# ra -r regex-anon.ra -M printer=encode32 -s suser:32
                                srcUdata
s[32]=333712F228948DABC9C0D199D1C3B00F

# ra -r regex-anon.ra -e '\x33'
# ra -r regex-anon.ra -e '\\x33'
# ra -r regex-anon.ra -e '33'

None of them produce anything (whereas only the first one should). Ideas?

I tried enabling debug output, but even -D10 does not produce any
lines about regex behaviour.
The system is CentOS 5.7 64bit, gcc v4.1.2, ra v3.0.7.1.


Btw. To confirm what the shell is delivering to the prog when \x is
single quoted:

# echo '\x33'
\x33
# echo \x33
x33
# perl -e 'print join(", ", @ARGV) ."\n"' -- -e '\x33'
-e, \x33
# echo '\\x33'
\\x33
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regex-anon.ra
Type: audio/x-realaudio
Size: 240 bytes
Desc: not available
URL: <https://pairlist1.pair.net/pipermail/argus/attachments/20121005/c9f20814/attachment.ra>


More information about the argus mailing list