I am currently working on a project where I need to validate user input for directions. The directions can be either "North", "South", "East", or "West". I am looking for a regular expression in PHP that can match any of these directions.
I have tried using the pattern `/[North|South|East|West]/`, but it seems to match any character within the square brackets rather than the whole word. For example, it would also match "N", "o", "r", "t", etc.
Can anyone please suggest a regular expression that can accurately match only the complete words "North", "South", "East", or "West" in PHP?
Any help or guidance would be greatly appreciated!
Thanks in advance.