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

23868Re: [Clip] Help with variables

Expand Messages
  • Don
    Jun 10, 2013
    • 0 Attachment
      Still not sure I follow ... but okay, just ask for what you want to match:
      ^!Set %animal%="(cat|rat|dog)"
      :start_loop
      ^!Set %singular%=^?{(T=L,H=5) Singular==_Singular Only^=1|Plural
      Only^=2|Both^=3}
      ^!If "^%singular%" = "1" single
      ^!If "^%singular%" = "2" plural
      ^!If "^%singular%" = "3" both
      ^!Goto start_loop


      :single
      ^!Replace "(^%animal%\b)" >> "*$1*" RWAIS
      ^!Goto start_loop


      :plural
      ^!Replace "(^%animal%s\b)" >> "*$1*" RWAIS
      ^!Goto start_loop


      :both
      ^!Replace "(^%animal%s?\b)" >> "*$1*" RWAIS
      ^!Goto start_loop



      On 6/10/2013 12:45 PM, John Shotsky wrote:
      > I need a way to find ONLY the singular version in one case, and I need to find any version in the other case.
      >
      > So, the task is to get the [s?] INTO each element of the second variable itself, not outside it. I realize I can also place parens
      > around the whole thing and treat it as one item, but that gets confusing when you have lots of numbered captures to sort out. Simply
      > put, I want to use (^%animal%)\b when I'm looking for the singular version, and (^%animals%)\b when I don't care which it is. But I
      > only want to have to enter all the animal names once, for the singular version of the variable. I just don't know how to do the
      > replaces inside the variable. That's why I asked.
      >
      > Regards,
      > John
      > RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/
      > John's Mags Yahoo Group: <http://groups.yahoo.com/group/johnsmags/> http://groups.yahoo.com/group/johnsmags/
    • Show all 12 messages in this topic