Generate regexp from format buffer
Study the regular expression