Overview
When a PDF contains web addresses, email addresses, or phone numbers as plain text (not as clickable link annotations baked into the file), Fastr Pubs won't detect them automatically. The Auto-Link Text (REGEX) tool solves this: it scans the visible text of your publication with a regular expression and drops a clickable link on top of every match — across all pages at once, if you want.
This article shows you how to fill in the two fields correctly for the most common link types, plus the gotchas that cause matches to fail or produce the wrong link.
Where to find it
Hover over the publication and click the three-dot menu (⋯).
Select Manage Publication from the menu.
In the Manage Publication options, select Auto-Link Text (Regex).
This will open the Auto-Link Text (Regex) dashboard, where you can configure the Regex and URL Pattern used to automatically create links within your publication.
How it works
The tool has two inputs:
- Pattern — a JavaScript regular expression that finds the text you want to turn into links. Wrap the part you want to put into the URL in parentheses
( )— that becomes capture group 1. - URL template — the link that gets built for each match. Anywhere you write
##1##, it is replaced by capture group 1.
Example: Pattern \b(\d{6,8})\b with URL template https://example.com/products/##1## finds any 6–8 digit SKU and links it to that product page.
The golden rule: scheme in the template, address in the capture
The URL template must start with http://, https://, mailto:, or tel:. If it doesn't, you'll see the red error:
"The URL template must start with http://, https://, mailto: or tel:."
This means you cannot use a bare ##1## as the template — even if the matched text already contains https://. The tool only validates the template string itself. The fix: put the scheme in the template, and capture only the address part in the pattern.
Recipes by link type
Run the tool once per link type — each type needs a different URL template, so you can't do them all in a single pass.
Web link — bare domain (e.g. example.com)
- Pattern:
\b([\w-]{3,}(?:\.[\w-]+)*\.(?:com|net|org|edu|gov|io|co))\b - URL template:
https://##1##
Add or remove TLDs in the (?:com|net|...) group to match what's in your publication. For domains that include a path (e.g. example.com/events), add (?:/[^\s]*)? before the closing parenthesis. The {3,} requires at least three characters before the dot, which prevents junk one-letter matches (see Troubleshooting).
Web link — starts with www.
- Pattern:
\b(www\.[^\s]+) - URL template:
https://##1##
Web link — already has http:// or https://
- Pattern:
https?://([^\s]+)— note the parentheses start after:// - URL template:
https://##1##
The capture holds only the address; the template supplies the scheme (this also upgrades everything to https).
Email (e.g. hello@example.com)
- Pattern:
([\w.+-]+@[\w-]+\.[\w.-]+) - URL template:
mailto:##1##
Phone number
- Pattern:
(\+?\d[\d\s().-]{7,}\d) - URL template:
tel:##1##
Matches formats like 555-123-4567, (555) 123-4567, and +1 555 123 4567, making them tap-to-dial on mobile.
Uppercase or mixed-case text (important)
Regular expressions are case-sensitive. A pattern written for lowercase www or lowercase TLDs (com) will not match uppercase text like WWW.EXAMPLE.COM — the match silently fails and no link is created.
Only the anchored literals in the pattern (www, http, and the TLD list) are case-locked — the [^\s]+ portion already accepts any case. To handle uppercase, make those literals case-insensitive with character classes:
- Uppercase/any-case
www.domain: Pattern\b([Ww]{3}\.[^\s]+)with templatehttps://##1##.[Ww]{3}matchesWWW,www, orWww. - Uppercase/any-case bare domain: Pattern
\b([\w-]{3,}(?:\.[\w-]+)*\.(?:[Cc][Oo][Mm]|[Nn][Ee][Tt]|[Oo][Rr][Gg]))\bwith templatehttps://##1##.
Domains are case-insensitive, so https://WWW.EXAMPLE.COM resolves correctly — you don't need to lowercase the text.
Special characters in the text (e.g. ®, ™) — use a manual link
Sometimes the on-page text contains a decorative symbol that isn't actually part of the address, such as a registered-trademark mark: example®s.com. Two problems arise:
- Symbols like
®are not word characters, so[\w-]stops at them — the full domain never matches. - Worse, the pattern can match a leftover fragment after the symbol. In the example above it matches
s.comand builds a broken linkhttps://s.com.
Because the tool builds the URL from the matched text, it cannot strip the symbol out or reassemble the real domain across the gap. When the visible text does not equal the real destination, link it manually instead: select the text and point it to the true address (e.g. https://examples.com). The {3,} in the recipes above stops the tool from auto-creating bogus one-letter fragment links in the meantime.
Options
- Pages: Apply to All pages (good for a footer email or phone that repeats), or limit to a Single page / Page range to control the blast radius.
- Open links in a new tab: Recommended for web and email links so readers don't navigate away from the publication.
Always Preview first
Click PREVIEW before applying. It highlights every match the pattern found, so you can confirm it caught the right text — and only that text — and that the link box sits correctly over each match. This is especially important for bare-domain patterns, which are the most prone to accidental matches.
Limitations
- Text split across separate runs cannot match. If a URL or email is broken across separate text runs in the PDF (for example, it wraps to a second line or has unusual spacing/kerning), the regex can't match across that gap. Add those few links manually.
- Proportional slicing. When a match sits inside a longer text run, the link box is given a proportional slice of that run's width.
Troubleshooting
- Red error "URL template must start with http://, https://, mailto: or tel:" — your template is missing a scheme (e.g. it's just
##1##). Put the scheme in the template and capture only the address part. See "The golden rule" above. - Nothing matched / no links created — most often a case mismatch (uppercase text vs. lowercase pattern — see the Uppercase section), or the text is split across runs.
- It linked the wrong fragment (e.g.
https://s.com) — a special character such as®broke the domain and the pattern matched the leftover piece. Delete the bad link and add a manual link. Use{3,}on the domain label to suppress one-letter fragments. - Too many things got linked — your pattern is too broad. Tighten the TLD list, add word boundaries
\b, and re-run Preview. - The link box looks off-centre — use Preview to verify placement before applying.
Comments
0 comments
Please sign in to leave a comment.