Validate a UK Grid Reference in Laravel 5

This will just be a small article and quite a specific one. We’ll be looking at how to verify an input to guarantee it is a valid 8 figure grid reference. This will be checking against the UK Ordnance Survey standard, so two letters followed by four easting numbers and four northing numbers. e.g. AA11112222 It is important to remove any spaces from the string before submitting. This can be achieved through a small JS function and a .replace function. … Continued