[build][core][fr] fix selection from the pattern end