Skip to content

Instantly share code, notes, and snippets.

View idlefingers's full-sized avatar

Damien Timewell idlefingers

View GitHub Profile
<div class='category ' id='category_1032'>
<h3 class='name'><a href="/categories/desktop-accessories-clipboards.html">Clipboards</a></h3>
<div class='image'><a href="/categories/desktop-accessories-clipboards.html" id="subcategory_image_1032"><img alt="Clipboards" src="http://www.officekitten.co.uk/images/products/536552/extra_small.jpg?1271253611" /></a></div>
<div class='product_count'>28 items</div>
</div>
This works, but not if you click on 'product_count'
def check_postcode(postcode)
alpha1 = "[abcdefghijklmnoprstuwyz]"
alpha2 = "[abcdefghklmnopqrstuvwxy]"
alpha3 = "[abcdefghjkstuw]"
alpha4 = "[abehmnprvwxy]"
alpha5 = "[abdefghjlnpqrstuwxyz]"
postcode_expressions = [
%r{^(#{alpha1}{1}#{alpha2}?[0-9]{1,2})(\s*)([0-9]{1}#{alpha5}{2})$}, # AN NAA, ANN NAA, AAN NAA, and AANN NAA
%r{^(#{alpha1}{1}[0-9]{1}#{alpha3}{1})(\s*)([0-9]{1}#{alpha5}{2})$}, # ANA NAA