Changed deprecated trim_chars to trim_matches