create pattern from ABC string