Hi, I'm trying to write an RE to match a postcode range, an example of what i need to match is a postcode begining with HE then the next digits between 7 and 13, i.e. from HE7 to HE13.
The only way I know how to write this is:
^HE(7|8|9|10|11|12|13)
Is there a more efficient way? That example doesnt look much bother but I have some others like AL231 to AL892, which, with my way would be:
^AL(231|232|233|234 .... 889|890|891|892)
(dots represent all numbers between 234 and 889)
I couldn't find anything in my books or by searching. My first instinct was to try
^HE[7-13]
which isn't allowed.
I hope I have explained my problem well enough. Thank you.






Bookmarks