remove start and end pattern from mid table.