[Bro-Dev] #422: Array-style index accessor for strings

Bro Tracker bro at tracker.icir.org
Mon Mar 28 17:48:20 PDT 2011


#422: Array-style index accessor for strings
-----------------------------+--------------------
 Reporter:  seth             |      Owner:
     Type:  Feature Request  |     Status:  new
 Priority:  Normal           |  Milestone:  Bro1.7
Component:  Bro              |    Version:
 Keywords:  language         |
-----------------------------+--------------------
 String octets should be addressable by index. Like this:

 {{{
 local abc = "abc";
 print abc[1];
    ==> "b"
 }}}

 Having reverse indexes would be nice too.  Like this:

 {{{
 local alpha = "abcdefghijklmnopqrstuvwxyz";
 print alpha[-2];
    ==> "y"
 }}}

 It would be nice to do substring extraction with it as well.  Like this:

 {{{
 local alpha = "abcdefghijklmnopqrstuvwxyz";
 print alpha[4,9];
    ==> "efghij"
 print alpha[-5,-3];
    ==> "vwx"
 }}}

-- 
Ticket URL: <http://tracker.icir.org/bro/ticket/422>
Bro Tracker <http://tracker.icir.org/bro>
Bro Issue Tracker



More information about the bro-dev mailing list