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

19135Re: [Clip] best way to substitute a list of items

Expand Messages
  • Flo
    May 1, 2009
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, Sheri <silvermoonwoman@...> wrote:
      >
      > Sorry I pressed Send before I was finished.
      >
      > ^!Replace "(?J)( (?<m>R)elay| (?<m>H)urdles| (?<m>)Run| (?<m>)Dash)" >>
      > "$<m>" RAWS0
      >
      > Starting Document text:
      >
      > 3200 Relay
      > 300 Hurdles
      > 400 Run
      > 100 Run
      > 100/110 HH
      >
      > After the replace is:
      >
      > 3200R
      > 300H
      > 400
      > 100
      > 100/110 HH
      >
      > Regards,
      > Sheri


      What about this...

      ^!Set %gender%=^?{Gender is...==_F|M}
      ^!Replace "(?|\x20(R)elay|\x20(H)urdles|\x20Run|\x20Dash)" >> "$1" AWRS
      ^!If ^%gender%=M Next Else Skip_2
      ^!Replace "^\d+/(\d+)\x20HH$" >> "$1H" AWRS
      ^!Goto End
      ^!Replace "^(\d+)/\d+\x20HH$" >> "$1H" AWRS

      Sheri uses (?J) which allows duplicate subpattern names. Just for a change, I tried (?| which allows duplicate subpattern numbers. I hope it will survive Sheri's critical eye ;-)

      I also tried to solve the "gender problem" that Don described in his first message.

      Flo
    • Show all 9 messages in this topic