RegexLinking Examples and Rules

This page is dedicated to the art of linking, but with a regular expression twist.

Below you'll find examples of how to use regex to link things.

Rule 1: Be Bold with /b/

Use the \b anchor to match word boundaries.

example.com /bexample.com

Rule 2: Capture Groups with (?:)

Use the (?:) to capture groups without including them in the output.

example\.com

Rule 3: Non-Greedy Matches with U

Use the U flag to make matches non-greedy.

example.com See more linking rules Learn advanced linking topics Get the best practices on regex linking