A Rule-Based Framework for Solving Regular Context Sequence Constraints