just use regex instead of native trim to deal with variations in implementations. Thanks @jdalton. closes #34