fix parsing bug and remove redundant regex parsing by storing matcher in MagicSourceEvent