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

23896Re: alphanumeric character transcoding, by ones and pairs

Expand Messages
  • rickah
    Jun 22, 2013
    • 0 Attachment
      That does simplify things. I don't have to guess which characters need to be escaped. Eventually, nearly all keyboard characters may need to be added to the list.

      --- In ntb-clips@yahoogroups.com, "flo.gehrke" <flo.gehrke@...> wrote:
      > Richard,
      > Two more ideas:
      > > >
      > If you like we could omit the escaping in the list and insert two command lines which will automatically check any search character and add the backslash if needed -- see below.
      > If you prefer this solution then remove all backslassh on the left in LIST.TXT.
      > Regarding these ideas, now the latest version could be...

      ^!IfMatch "(\.|\[|\(|\)|\^|\$|\*|\+|\?|\\|{|\|)" "^%Search%" Next Else Skip
      ^!Set %Search%=\^%Search%

      I've put the list.txt in the notepad.exe folder so I don't lose track of it.

      Would you be able to help implement the suggestion of Ian to use a clip list instead? I'm thinking it would make things much easier to share. (The clip H="_list" matches the LIST.TXT.)

      > ^!SetListDelimiter ^p
      > ^!SetArray %Charpair%=^$GetClipText("list")$
      > ^!Set %i%=0

      > :Loop
      > ^!Inc %i%
      > ^!If ^%i% > ^%Charpair0% Out
      > ^!SetListDelimiter ^T
      > ^!SetArray %pair%=^%Charpair^%i%%
      > ^!Set %Search%=^%pair1%
      > ;^!Inc %i%
      > ^!Set %ReplaceWith%=^%pair2%
      > ^!Replace "(?<!\|)^%Search%" >> "|^%ReplaceWith%" WARS
      > ^!Goto Loop

      One very minor error when setting list items; with "M|&Sl", the letter M is replaced by the complex character "&Sl". I found that this entry must follow "S|p" or "&Sl" beocmes "&pl".

      This reminds me that I'll eventually be working with character codes such as: ၁ and "\u1063\u103A". Do you foresee much difficulty?

    • Show all 19 messages in this topic