Regex collection

This is a collection of regex expressions I often use. They are not perfect and 100% correct, but will catch most errors a user normally makes. Email addresses /^[a-zA-Z0-9.!#$%&โ€™*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/ Phone number /^(\+|0{1,2}?)[1-9][\d -]+\/?[\d -]+$/ Matches: +49301234567 00 49 30 123 โ€“ 456 โ€“ 7 030 / 123 45 67 030/1-2-3-4-5-6-7 German postalcode / ZIP /^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$/ Regulรคrer Ausdruck fรผr Deutsche Postleitzahlen Date (dd.mm.YYYY) /^\d{2}\.\d{2}\.\d{4}$/

April 20, 2019 ยท 1 min ยท Anton Bracke

Browsersync

Stop reloading your browser by hand anytime your css, js or template re-renders. Try using Browsersync.ย I really started loving this tool. Everytime your sass or js gets compiled or you simply changed one thing in your template, browsersync detects the file change and simply reloads your page. One nice extra is that css is reloaded without reloading the complete page. To use it just install it via npm: npm install -g browser-sync I just created a small helper script for my Silverstripe projects, but you could simply change the folder and use it with everything else:...

August 8, 2018 ยท 1 min ยท Anton Bracke