Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
How to match a *three*-letter string (Read 725 times)
J Fallows
Full Member
*
Offline



Posts: 418

How to match a *three*-letter string
Mar 22nd, 2016, 2:28pm
 
The word operator, as described in aTbRef here http://www.acrobatfaq.com/atbref6/index/ActionsRules/Operators/FullOperatorList/..., applies to words of four characters or more.

I want to create an agent that will find notes that have a given three-character "word" in their $Text. Let's say FDR or DDE or HBO etc.

What's the right syntax for that, in an agent? Asking "in public" in case others have wondered about this too.

Update: Is it something as simple as contains? As in:

$Text.contains("FDR")

Update^2: Answering my own question, $Text.contains("FDR") does indeed seem to be the answer. Leaving this here in case anyone else has wondered.
Back to top
 
« Last Edit: Mar 22nd, 2016, 3:11pm by J Fallows »  
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: How to match a *three*-letter string
Reply #1 - Mar 22nd, 2016, 4:11pm
 
.contains("MDW") will get you to Chicago.  

This won't be quite as fast as the word() operator, but that doesn't really matter in Tinderbox Six, where (a) this will be fast enough, and (b) it's done in the background anyway.
Back to top
 
 
WWW   IP Logged
J Fallows
Full Member
*
Offline



Posts: 418

Re: How to match a *three*-letter string
Reply #2 - Mar 22nd, 2016, 5:57pm
 
Quote:
This won't be quite as fast as the word() operator


Thanks -- and just to be sure I understand, word() still requires four-character-or-longer units for a match, right? So it's not an option of using a theoretically faster word() operator to find FDR / MDW etc? Thanks
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: How to match a *three*-letter string
Reply #3 - Mar 22nd, 2016, 10:06pm
 
Correct.

Also, word(dred) may not find Mordred, while .contains() will.  In your case, the three-letter acronyms -- airport identifiers? -- would be found, but word() ignores 3 letter words.
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print