擅长:python、mysql、java
<p>在我自己解决类似低级问题的代码中(使用基于ASCII控制代码的信息定界符,如SOT、EOT、NULL、BELL等解析串行端口协议的原始流),我使用了一组regex和标准比较器。它很容易在代码中构造以供其他人理解,而且使用预编译的regex也相当快。在</p>
<p>如果我想在不添加任何非系统依赖项的情况下获取字段,我不需要为它编写精确的python代码,我将使用类似于伪代码的代码。在</p>
<pre><code> Start Loop over packet content.
Match any Tag
Match specific tag type
set array index based on tag type
extract length of value
extract tag value
store value in array at the index set above
slice off all the entire now matched & extracted tag.
Loop until end no more tags match.
End of loop
</code></pre>