haxe - Match hexadecimal notated bytes regex -


I try to match regular expressions -> ~ and try hexadecimal byte group (i.e. 2 digit hex value) I am / I want to store these grouped matches without changing the original string sbytes . .

What do I need to do to get this? Thanks.

  var sbytes: string = "cafebaab" var hexar = ~ / ([0 - 9AF] {2}) / / a match hexadec L. Note byte.Haxor.Match (SBA); Trace (HEXRmatched (1)); // I want to match each byte (CA, FAF, BA, BA) in the match group / (like ca = hexr.matched (1), fe = hexr.matched (2), et cetera. // How do I do this?  

  class Test {static function main () {var sbytes: String = "cafebabe"; Var hexbite ri = ~ / [0-9a -f] {2} /; Var status = 0; While (hexbitter.machsp (sbytes, pos)) {trace (hexbitterarmlet (0)); Var mp = hexbyteRe.matchedPos (); Pos = mp.pos + mp.len; }}}  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -