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

3830Re: [Clip] RegExp Replace Side

Expand Messages
  • Wayne VanWeerthuizen
    May 30 10:18 PM
    • 0 Attachment
      Jody <KJB1611@...> wrote:
      >Hi All,
      >
      >How can I use RegExp on the replace side of ^!Replace. The way
      >I understand it we can do it in v4.82. I am try trying to wrap
      >the search criteria. I already have Clips to do it, but would
      >like to learn this.
      >
      >H=Snatch Highlight
      >^!Select All
      >^!Replace "H=.*" >> "<EM>H=.*</EM>" HSR
      >; ^!Select All
      >; ^!Replace "\n:.*" >> "\n<FONT CLASS=red>:.*</FONT>" HASR
      >; ^!Select All
      >; ^!Replace "\n;.*" >> "\n<FONT CLASS=tangerine>;.*</FONT>" HASR

      Instead of:
      ^!Replace "\n:.*" >> "\n<FONT CLASS=red>:.*</FONT>" HASR

      You probably wanted:
      ^!Replace "\n:{.*}" >> "\n<FONT CLASS=red>:\1</FONT>" HASR

      But I don't have more time now to test this for you. Good luck.

      ===========

      The regular expressions tokens are of three kinds.

      Search Tokens:
      . * + ? [ ] ( ) { }
      Search tokens are only have their special meanings when used
      in the find portion.

      Character tokens:
      \s \t \b \r \l \n
      These ought to be useable on either the find or the replace
      expression.

      Replace Tagged Match:
      \1 \2 \3 \4 \5 \6 \7 \8 \9
      These only have their special meaning when used in the
      repace expression. \1 means the same text as matched
      the pattern within the first pair of curly brackets
      in the find expression.

      (The above is not meant to be a complete list of tokens.)




      --
      Wayne M. VanWeerthuizen
      Homepage: http://landru.myhome.net/wayne
    • Show all 7 messages in this topic