carried the trim= argument through for extract to speed things up close #1
moved to use stringi for extraction close #1