Phrases and tokens
How a plugin finds words in a text: phrases, tokens like {digits:6}, and what a match gives it.
A plugin finds words in a text with phrases: plain words, like your bill is ready, with tokens where something varies, like amount due {amount}. There are no regular expressions and no code. The app turns each phrase into a search of its own making, with every repeat in it bounded, so a phrase can't run away with a phone however long or strange the text it reads.
A phrase
A phrase is 1 to 120 characters on one line, keeping the rules for words in a plugin. Read from left to right:
{starts a token, which runs to the next}: a name, then optionally:Nor:N-M.{digits:6}is{digits:6-6}, exactly six digits.{{is a plain{, and}}a plain}.- A run of spaces is one gap, which matches any run of space in the text: one space, several, a line break.
- Everything else is matched as it is: letters in any case, and every other character as itself. A
.is a full stop, never "any character".
The tokens
| Token | Matches | For example |
|---|---|---|
{digits:N-M} | A run of N to M digits, not part of a longer run. 1 to 24, and 1-24 if you give no numbers. | your code is {digits:4-8} finds 123456 in "Your code is 123456.", and nothing in "Your code is 1234567890". |
{number} | A number: 1,234, 1.234,5, 98765 or 12.5. The whole run of digits, dots and commas it sits on, or nothing: 192.168.1.1 is no number. | order {number} finds 1,234 in "Order 1,234 shipped". |
{amount} | A number with a currency sign or code before or after it: $45.20, 45,00 EUR, £30. The signs are $, €, £, ¥ and ₹; the codes USD, EUR, GBP, CAD and AUD, in any case. | amount due {amount} finds $1,234.56 in "Amount due $1,234.56 by Friday", and nothing in "Amount due 45 by Friday". |
{code:N-M} | A whole word of N to M letters and digits with at least one digit in it. 4 to 24, and 4-10 if you give no numbers. | code {code:4-8} finds AB12CD in "Use code AB12CD to sign in", and nothing in "Use code ABCDEF to sign in". |
{word} | One word: letters, digits, ' and -. | {word} delivery finds Acme in "Your Acme delivery is near". |
{words:N-M} | N to M words of anything but spaces, between two plain parts of the phrase. 0 to 4, and 1-3 if you give no numbers. | your {words:0-3} has shipped finds "new blue parcel" in "Your new blue parcel has shipped!" |
{url} | A web address starting http://, https:// or www.. | track {url} finds https://example.com/t/123 in "track https://example.com/t/123 now". |
{email} | An email address. | from {email} finds bob.smith+x@mail.example.co.uk in "Reply from bob.smith+x@mail.example.co.uk." |
{phone} | A phone number of 7 to 15 digits, with spaces, brackets, dots or dashes among them. The whole run it sits on, or nothing: two numbers with only a space between them read as one run. | {phone} finds +1 (555) 010-0100 in "Call +1 (555) 010-0100 today". |
{date} | A date: 12/03/2026, 2026-11-20, March 5th, 5 jan. Months are in English. | on {date} finds March 5th in "Your appointment on March 5th at 3pm". |
{time} | A time: 3pm, 10:30 a.m., 14:05. | at {time} finds 10:30 a.m. in "See you at 10:30 a.m. sharp". |
The rules a phrase keeps
A phrase that breaks one of these doesn't load, and says which at its place in the file (rules.tags[0].any[2]). They're checked in this order, and the first one broken is the problem given.
| Rule | Broken by | Problem |
|---|---|---|
| Two tokens need something between them. | {digits:4}{digits:4} | phrase_tokens_touch |
A token can't touch a letter or digit. Punctuation may touch one: #{digits:4-10} and code:{code} are fine. | bill{digits:4} | phrase_token_touches_word |
{words} needs a space on each side, so it can't be first or last. | {words:1-2} bill | phrase_words_edge |
{url} must be followed by a space or the end of the phrase. | {url}. | phrase_url_followed |
At most 4 tokens, and only one {words} and one {url} among them. | a {digits} b {digits} c {digits} d {digits} e {digits} | phrase_too_many_tokens |
| A phrase with no token needs at least two letters or digits. | a | phrase_too_short |
Besides those: a token the app doesn't know, numbers it can't take, a { with no } or a } on its own is phrase_bad_token ({digits:0}, {digits:9-4}, {foo}, code {code:3}, go {words:5}, x {word:2} y, bill }). An empty phrase, one over 120 characters, one with a space at its start or end, a line break or an invisible character is phrase_bad_text.
How a phrase matches
- Whole words. A phrase that starts or ends with a letter or digit matches only whole words there:
billfinds "bill" in "Your bill is ready", but nothing in "Your billing statement". - Any case. Letters match in either case, accented ones too:
your apptfinds "YOUR APPT", andcaféfinds "CAFÉ". - Curly quotes and dashes. Before matching, the text and the phrase both have curly quotes made straight, dashes made
-and odd spaces made plain ones, sodon't forgetfinds "Don’t forget" written with a curly apostrophe. - The first 2,000 characters of a text are read, and the rest isn't.
- The anchor. A phrase's longest run of plain letters and digits (a to z, 0 to 9), at least three long, is its anchor: the first, where two are as long. The phrase is only tried on a text that has its anchor in it, in any case, which is how hundreds of phrases stay quick.
your code is {digits:4-8}'s anchor isyour, andtracking no. {code:8-24}'s istracking. A phrase with no such run, like{phone},at {time}orcafé, is anchorless: it's tried on every text, so a plugin may have only 8.
What a match gives
A match gives two things: the whole of what the phrase matched, and what its first token found. A tag rule's detail keeps one of them for its tag, for a row or a copy button to show:
{"from": "token"}: what the first token found.amount due: {amount}on "Amount due: 45,00 EUR." keeps 45,00 EUR.{"from": "match"}: the whole match. The same phrase keeps "Amount due: 45,00 EUR".
Each is trimmed, and an empty one keeps nothing: your {words:0-3} has shipped matches "Your has shipped", with no detail.
Limits
| What | At most |
|---|---|
| A text, as read | its first 2,000 characters |
| A phrase | 120 characters |
| Tokens in a phrase | 4, one {words} and one {url} among them |
any, all and none in a rule | 30, 8 and 20 |
Phrases in a plugin, every any, all and none | 200 (too_many_phrases) |
| Anchorless phrases in a plugin | 8 (too_many_anchorless) |
| Plugins on one device, from the Marketplace and in development together | 16 (too_many_packs) |
| Phrases in all of a device's plugins | 1,600 (too_many_phrases) |
The person's own words in a wordsFrom | the first 50, each cut to 60 characters |
| What a token finds | 24 digits; a code of 24; a word of 32; 4 words of 32 each; a web address of 200; an email address of 64 characters, an @, and up to five parts of 63 |
A slow plugin
A phrase can't run away, but a plugin of 200 phrases on a busy phone could still be slow, so the app times every plugin from the Marketplace or in development as it reads each text:
- A text that takes it 20 milliseconds or more is read again at once; if that takes as long, it's a strike. So a slow plugin is caught, and a phone that was only busy for a moment isn't held against it.
- More than 100 milliseconds of reading in any one second is a strike too, where its texts took it a millisecond or more each on average. The app reads every conversation again whenever a switch or a setting changes, and a plugin that's quick on each text isn't held against that.
- More than half of any one second spent reading is a strike however quick it is on each text, so a plugin that's nearly a millisecond a text can't hold the app for seconds every time a switch changes.
- The first text after it starts never counts: that's when its phrases are made ready.
- Five strikes in ten minutes pause it. It does nothing while paused, its page says Paused: it was slowing the app down. with Turn it back on, and the pause is kept, across restarts, until then or a new version.
Examples
| Phrase | Text | Gives |
|---|---|---|
your code is {digits:4-8} | Your code is 123456. | 123456 |
your code is {digits:4-8} | Your code is 1234567890 | no match (ten digits) |
code {code:4-8} | Use code AB12CD to sign in | AB12CD |
code {code:4-8} | Use code ABCDEF to sign in | no match (no digit) |
amount due {amount} | Amount due $1,234.56 by Friday | $1,234.56 |
amount due {amount} | Amount due 45 by Friday | no match (no currency) |
amount due {amount} | Amount due: 45,00 EUR | no match (the colon isn't in the phrase) |
amount due: {amount} | Amount due: 45,00 EUR. | 45,00 EUR |
your {words:0-3} has shipped | Your parcel has shipped | parcel |
your {words:0-3} has shipped | Your has shipped | a match, with nothing found |
your {words:0-3} has shipped | Your new blue parcel has shipped! | new blue parcel |
your {words:0-3} has shipped | Your very big new blue parcel has shipped | no match (five words) |
bill | Your billing statement | no match (not a whole word) |
bill | Your bill is ready | bill |
track {url} | Track it: https://example.com/t/123 | no match (the "it:") |
track {url} | track https://example.com/t/123 now | https://example.com/t/123 |
{phone} | Call +1 (555) 010-0100 today | +1 (555) 010-0100 |
on {date} | Your appointment on March 5th at 3pm | March 5th |
on {date} | Booked on 12/03/2026. | 12/03/2026 |
on {date} | See you on 5 jan | 5 jan |
at {time} | See you at 3pm | 3pm |
at {time} | See you at 10:30 a.m. sharp | 10:30 a.m. |
don't forget | Don’t forget your parcel (a curly apostrophe) | Don't forget |
your appt | YOUR APPT is at 9 | YOUR APPT |
café | Le CAFÉ est ouvert | CAFÉ |
from {email} | Reply from bob.smith+x@mail.example.co.uk. | bob.smith+x@mail.example.co.uk |
ref #{digits:4-10} | Booking ref #88213 confirmed | 88213 |
{word} delivery | Your Acme delivery is near | Acme |
order {number} | Order 1,234 shipped | 1,234 |
order {number} | Order 98765 shipped | 98765 |
tracking no. {code:8-24} | Tracking no. JD014600006295117 | JD014600006295117 |
ticket {{ref}} {digits:3} | Ticket {ref} 123 | 123 |
50% off | Get 50% off today | 50% off |
a.b.c | see aXbXc here | no match (a . is a full stop) |
Where a phrase has a token, "Gives" is what its first token found; where it has none, the whole match.
The person's own words
A words setting lets the person type words of their own, a line each or with commas between. A tag rule's wordsFrom names that setting, and each of the first 50 entries, cut to 60 characters, becomes a phrase that joins the rule's any. Their words are taken as plain words: braces in them are plain braces, never tokens. They match as any phrase does, as whole words in any case, and an entry that can't be a phrase (a single letter, say) is passed over without a word.
Bills' More words for bills is one, with council tax, water rates as the example in its field.
Docs