Programming guide

Find and fix text faster with regular expressions

Learn the regex patterns you will actually use to search, validate and bulk-edit text in your editor or code, and test them safely before changing files.

Estimated time: 45–90 minutesUpdated: 2 October 2026

Use this guide when you need to find patterns rather than exact words, such as every date, postcode or email address in a file, or to tidy hundreds of lines at once. You need a code editor with regex search (for example VS Code) or a scripting language, plus a copy of the text to practise on.

Step by step

  1. Practise on a copy with a live tester

    Copy a sample of your real text into a new file or an online regex tester and never experiment on the only copy. Turn on the regex option in your editor's search box, usually shown as .* in VS Code. Seeing matches highlight as you type is the fastest way to learn.

Members

The rest of this guide is for members

The rest of this guide – the remaining steps, a ready-to-use checklist, practical tips and fixes for common problems – is for members. Membership unlocks every ABCDayZ guide.

£3.99 for 1 month or £29 for 12 months. One payment, no automatic renewal.

Unlock all guides

Already a member on another device? Open your personal access link. Bought Programming with AI? Your first month is included.