@eastgate posted while I was drafting, but as this is done…
Firstly, I really concur the point about messy data. Make sure what you are matching if what you mean to match.
For instance you might do well to do one, or more agent queries and add a $Tags value or a user attribute value of some sort to those articles where a link is actually needed. More work? Yes, but a cleaner result so arguably the extra work is warranted in the time later lost following inappropriate links. Even more so if you are going to use further automation based on the existence of those links. Garbage in, garbage out. Computers struggle with nuances obvious to the human brain—and vice-versa.
Here below, are some current approaches you can use at present, but I’d agree with @eastgate that better is to come soon in v9.
OK, so you want note “F. W. Taylor” to link to (from?) the original of any note whose $Text includes the (exact) substring “F. W. Taylor”. Some thoughts
Context of use. As you need to use a regex search on $Text you don’t want this running on a Rule or full-on agent. For an action, I’d use a stamp (run once per selected note per application) or an edict. With an agent I’d run it and then turn the priority down or delete it. Why delete the agent rather than turn it off? Turning off retains all the aliases and their rules and edicts may still run. Thus you may have 100s of aliases still pointlessly evaluating their rules/edicts.
Agent approach. Make an agent to query
$Text.contains("F\. W\. Taylor"). The escapes because a full stop is a regex special character matching any character. Better would be to store “F. W. Taylor” in $MyString in the agent and make it visible as a Displayed Attribute. Then query
$Text.contains($MyString(agent)). this makes re-use of the agent much easier. Then the agent action is
linkFromOriginal(this, "cites"), you can chose To/From direction as suits.
Action approach. Here you have to encapsulate the query in the action. So for note with $Name
F. W. Taylor it could be stamped like so:
$MyList = collect(find($Text.contains($Name(that))& $IsAlias==false),$Path);
Of the two approaches, the action stamp has more flexibility. I’d not use it in an edict or rule as you’d be running a lot more
.contains() operations than needed.