control characters in Replace string

  • Advertisement ( why? )
     

    BucksVsBytes, 19th Jan 2014 3:57 am

    In HTML-Kit Tools Version 20131106, I want to REGEX replace certain characters with Tab (x09) characters, but the Replace string \t is interpreted as a literal backslash and a literal letter t. Same result in single- and multi-line modes.

    I can use regex escape characters successfully in the Find string.

    What is the correct Replace string?

    • HTML-Kit Support, 20th Jan 2014 8:39 pm

      On 1/19/2014 3:57 AM, BucksVsBytes wrote:

      In HTML-Kit Tools Version 20131106, I want to REGEX replace certain
      characters with Tab (x09) characters, but the Replace string \t is
      interpreted as a literal backslash and a literal letter t. Same
      result in single- and multi-line modes.

      I can use regex escape characters successfully in the Find string.

      What is the correct Replace string?

      Hi,

      You can insert raw characters in the replace field, and it might be
      easier to keep a list of characters and replace strings in your Paste
      From dialog:

      Click "Replace expression" label itself and select "Paste From." From
      there you can pick up text from other open docs, Copy and Paste pad and
      the clipboard.

      If your find regex includes \t character, you could also group it (\t)
      and reference it in replace field with $1 (or the group id).

      Hope this helps.

      Chami

      • BucksVsBytes, 21st Jan 2014 4:49 am

        Thanks, that was a big help. I know how difficult it is to reconcile Windows navigation conventions with special needs such as entering literal Tab characters, but the handling of such needs in Tools is not transparent and quite cumbersome. At the least, the inexperienced user needs a text cue to notify them that clicking on the "Find Expression" and "Replace Expression" labels accesses special capabilities. Another approach might be a special key and button that toggles the find or replace textbox to a fully editable screen.

        Also, can you provide a link to a user manual or syntax description of the particular implementation of Regex you're supplying? There are so many variations now that it's hard to know which features are available. For example, is there a way to use global pattern modifiers, such as "ignore case"?

        • HTML-Kit Support, 21st Jan 2014 10:07 am

          On 1/21/2014 4:49 AM, BucksVsBytes wrote:

          Thanks, that was a big help. I know how difficult it is to reconcile
          Windows navigation conventions with special needs such as entering
          literal Tab characters, but the handling of such needs in Tools is
          not transparent and quite cumbersome. At the least, the inexperienced
          user needs a text cue to notify them that clicking on the "Find
          Expression" and "Replace Expression" labels accesses special
          capabilities. Another approach might be a special key and button that
          toggles the find or replace textbox to a fully editable screen.

          I agree with you in general. Although I've tried to make field labels
          like "Replace expression" stand out (different color, underlines on
          hover and "Click for more options" tooltip), it's still not obvious at a
          glace. On the other hand, making it super obvious tends to clutter the
          interface. HTML-Kit Tools UI tries to use the status bar and tooltips
          for quick hints.

          Also, can you provide a link to a user manual or syntax description
          of the particular implementation of Regex you're supplying? There are
          so many variations now that it's hard to know which features are
          available. For example, is there a way to use global pattern
          modifiers, such as "ignore case"?

          Yes, (?i) is supported. To ignore case for all of it, you could also
          turn of Case Sensitive option on the replace dialog. Most everything
          you'd find in a PCRE-like regex reference out there is supported.

          Please post again if you have any other questions.

          Chami