Make the regexp capture properly.