sbom.go - trimming and reversing for a set of patterns