Extract match decode into a function

Signed-off-by: chatgris <jboyer@af83.com>