fix beginend bug and switch to stdlib QuoteMeta