I'm trying to write javascript that validates a form value of a grid coordinate.
The grid has A to H and 1 to 8, with coordinates written as a letter followed by a number eg. "A1", "H8", "B6", "F3".
Can anyone give me a regex that will rule out anything other than coordinates within that range.
I tried the following:
/^[A-H][1-8]$/ based on my really limited knowledge of regex but that hasn't worked out

but that hasn't worked out- please edit the question to explain what you're expecting and what you're seeing (with related JS code/examples). That regex does what is described - matching strings that consist of only one letter, A to H, followed by a number, 1 to 8 - so if it "doesn't work" the problem isn't the regex itself.^) with a capital letter in the range from "A" to "H" ([A-H]) followed by a digit in the range from "1" to "8" ([1-8]) and then the string must be end ($)