In this paper we describe how rolling stock and passenger connections in a cyclic railway timetable can be modeled in a flexible way within the model for the Periodic Event-Scheduling Problem (PESP). Usually, PESP models assume that the constraints for rolling stock or passenger connections specify in detail which trains should connect with each other. However, the flexibility described in this paper allows the model to choose which trains should connect with each other in a rolling stock or passenger connection. We express the connection times in a minimum matching of arriving and departing trains in terms of certain process time variables. We also describe an abstract framework demonstrating that, under certain conditions, the extra flexi...