Sorcerer's IsleDocs cfRegexOverviewCode

Regex Feature Overview

Introduction

This section covers the basic features which are used in a regex pattern to instruct the regex engine what it is looking for.

Whilst it is intended to give someone new to regex a knowledge of all the syntax elements, the docs also cover things which may be new even to experienced regex users, so is worth reading through whatever your level.

If there is anything within these pages that you are unsure about or that could be explained better, please send a message to the mailing list - this documentation is still a work in progress, and feedback is welcome!

Features

Metacharacters are characters in a regex pattern with special meaning which make up the instructions which the regex engine uses when attempting to match.

These can be used to indicate characters which should match, but also to verify that the matches occur at particular Positions within the text.

Sometimes it is necessary to use Encoded Characters in regex, if the literal character would be unclear or is not able to be represented directly.

Character Classes are used to represent any single character out of a set of possible matches, or to represent a negated set of characters which should not match.

Quantifiers allow the specification of minimum and/or maximum number of times the preceeding item is allowed to match.

Groups allow you to treat several characters as a single item to be acted on, as well as being able to capture the contents of the group for use in backreferences.

Alternation is a way to specify multiple possible paths down which a regex can match.