Loading ...
Sorry, an error occurred while loading the content.

23864Re: [Clip] Help with variables

Expand Messages
  • Don
    Jun 10, 2013
    • 0 Attachment
      Not sure what you are trying to do John, but regex is your friend.
      ^!Set %animal%="(cat|rat|dog)(s?)"
      ;uncomment find or replace
      ;^!Find "^%animal%" CIRS
      ;or
      ^!Replace "^%animal%" >> "*$1$2*" RAWH


      On 6/10/2013 11:10 AM, John Shotsky wrote:
      > I would like some ideas for how to handle the following issue efficiently.
      >
      > I set a variable called %animal%
      > In that variable, I store cat|dog|rat, all without parens or plurals.
      >
      > I would like to keep that variable, because there are times it needs to work only on singular animals, but I want another variable
      > that includes the singular word with ['s?] added to it, so it will capture both the singular and plural words.
      >
      > So, one variable would be cat|dog|rat
      > And the second would be made from the first one by adding [s?] to each term.
      > cats?|dogs?|rats?
      >
      > I have tried various ways to implement this and haven't found a satisfactory way. The reason I need this is so that the plural term
      > is always captured if present as when ^%animals% is used. I know I need to substitute [%s|] for each vertical bar, but it needs one
      > on the last term too. Any ideas for how to form this variable correctly? (I guess I could form a fake term, like zzzzz for the last
      > one, but I'd still like to know how to do it right.)
      >
      > Here's a test phrase:
      > The cats play with the dogs. The rat chases the cat. The dog chases the rats.
      >
      > ^%animal% should find only singular as in (^%animal%)\b
      > But (^%animals%) should capture both singular and plural and never miss an 's' if present.
      >
      > Thanks,
      > John Shotsky
      >
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      > ------------------------------------
      >
      > Fookes Software: http://www.fookes.com/
      > NoteTab website: http://www.notetab.com/
      > NoteTab Discussion Lists: http://www.notetab.com/groups.php
      >
      > ***
      > Yahoo! Groups Links
      >
      >
      >
      >
    • Show all 12 messages in this topic