Fix an error in regex computation that falsely established an optional field as a static one.

Includes a specific unittest.
Merge branch 'feature/newAPI' of dev.netzob.org:netzob into feature/newAPI