Skip to content

Instantly share code, notes, and snippets.

@prioritypie
prioritypie / uk-number-plate-validation.md
Created July 21, 2025 09:39 — forked from danielrbradley/uk-number-plate-validation.md
Regular Expression to Validate UK Number Plates

Regular Expression to Validate UK Number Plates

Regular Expression

(?<Current>^[A-Z]{2}[0-9]{2}[A-Z]{3}$)|(?<Prefix>^[A-Z][0-9]{1,3}[A-Z]{3}$)|(?<Suffix>^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(?<DatelessLongNumberPrefix>^[0-9]{1,4}[A-Z]{1,2}$)|(?<DatelessShortNumberPrefix>^[0-9]{1,3}[A-Z]{1,3}$)|(?<DatelessLongNumberSuffix>^[A-Z]{1,2}[0-9]{1,4}$)|(?<DatelessShortNumberSufix>^[A-Z]{1,3}[0-9]{1,3}$)|(?<DatelessNorthernIreland>^[A-Z]{1,3}[0-9]{1,4}$)|(?<DiplomaticPlate>^[0-9]{3}[DX]{1}[0-9]{3}$)

For use in JavaScript (with named groups removed):

(^[A-Z]{2}[0-9]{2}\s?[A-Z]{3}$)|(^[A-Z][0-9]{1,3}[A-Z]{3}$)|(^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(^[0-9]{1,4}[A-Z]{1,2}$)|(^[0-9]{1,3}[A-Z]{1,3}$)|(^[A-Z]{1,2}[0-9]{1,4}$)|(^[A-Z]{1,3}[0-9]{1,3}$)|(^[A-Z]{1,3}[0-9]{1,4}$)|(^[0-9]{3}[DX]{1}[0-9]{3}$)
@prioritypie
prioritypie / ubuntu20.04_php7.4_sqlsrv.sh
Created April 12, 2023 11:11 — forked from leidison/ubuntu20.04_php7.4_sqlsrv.sh
Install PHP 7.4 and SQLSRV on Ubuntu 20.04
#!/bin/bash
#ubuntu 20.04
#php7.4
# install php ppa
apt -y install software-properties-common
add-apt-repository ppa:ondrej/php -y
apt update
@prioritypie
prioritypie / ResponsiveRowRenderer.js
Last active January 15, 2020 14:35
Custom rowRenderer for jsGrid for responsive fields
/**
* Add "shiftFieldBelow: true" to any field that should appear in an
* additional row below the main results row.
* Classes can be applied to make the original field and the newly
* added row visible at different screen sizes
*
*/
/**
* The following get passed as options in the main jsGrid config/call
@prioritypie
prioritypie / videocontainer.html
Created July 24, 2019 14:16
VideoContainer HTML
<div class="container" style="margin-top: 30px;">
<div class="row">
<div class="col-xs-12 col-lg-6 col-lg-push-6">
<!-- Th col-lg-push... and col-lg-pull below will change the apparent order of these columns on lg -->
TITLE STUFF
</div>
<div class="col-xs-12 col-lg-6 col-lg-pull-6">
<div class="homepage-video equalise videoWrapper">
<!-- Note that the videoWrapper div needs to go inside the col-* otherwise its style will takeover -->
VIDEO STUFF
@prioritypie
prioritypie / seasonaltest.html
Last active July 24, 2019 14:06
HTMLStructure
<div class="container-fluid" style="margin-bottom: 30px;">
<div class="row"
<div class="col-xs-12" style="background: #ccc;">
<div class="container">
<div class="row" style="padding-top: 1.5em">
<div class="col-xs-12 col-md-6">
<h2>What's On</h2>
</div>
<div class="col-xs-12 col-md-6">
<a href="/events?fwp_events_festival_years=2019"><h4>VIEW ALL EVENTS</h4></a>
<!--
//
// Basic meta
//
-->
// Uses "Meta title" TV, or defaults to "Page Name - Site Name"
<title></title>
// Uses "Meta Description" TV, defaulting to "Summary/intro" or "Description"