i have an assignment where i should check validity of the string where :
- N90 -> North and must have key degree between 0-90
- W180 -> have degree between 91-180
- S270 -> have degree between 181-270
- E360 -> have degree between 271-360
how can i create a reg ex like this.
Don’t use a regular expression. This is a classic example of the kind of problem that regular expressions are not appropriate for. Just split the string into a direction (the first character) and a number, and check that the number meets the required conditions for the direction.