Mod code review and small optimisations
Add character type as \[CdDhHNRsSvVwWX]|[pP]{[^}]+}
Add dots to the begins and ends of the railroad