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

Is there a way to use regular expressions in StrReplace?

Expand Messages
  • Grant Botes
    Hi all I need some more help, please. I want to find a way to replace all word delimiters (e.g. ! &()*+,- ./:; ?@[ ]^`{|}~ ) in a selection with the
    Message 1 of 2 , May 2, 2003
    • 0 Attachment
      Hi all

      I need some more help, please.

      I want to find a way to replace all word delimiters (e.g. !"&()*+,-
      ./:;<=>?@[\]^`{|}~ ) in a selection with the underscore "_"
      character. Is there a way to do this easily?

      I had thought of using regular expressions with StrReplace rather
      than using umpteen StrReplace's to remove all of the possible
      characters one at a time. Can it be done? I haven't tried it yet 'cos
      I'd sort of like to know whether its do-able beforehand.

      The question has arisen because I find the HTML Help compiler doesn't
      like the word delimiter characters in table of contents and index
      file entries, and fails to execute certain hyperlinks that contain
      them.

      Thanks and regards,
      Grant Botes
    • hugo_paulissen
      Grant, You don t need to use the replace all characters one by one: From help: w any word delimiter. Matches any of t s! &()*+,-./:; ?@[ ]^`{|} Regards,
      Message 2 of 2 , May 2, 2003
      • 0 Attachment
        Grant,

        You don't need to use the replace all characters one by one:

        From help:

        \w any word delimiter. Matches any of \t\s!"&()*+,-./:;<=>?@[\]^`{|}

        Regards,

        Hugo

        > I need some more help, please.
        >
        > I want to find a way to replace all word delimiters (e.g. !"&()*+,-
        > ./:;<=>?@[\]^`{|}~ ) in a selection with the underscore "_"
        > character. Is there a way to do this easily?
        >
        > I had thought of using regular expressions with StrReplace rather
        > than using umpteen StrReplace's to remove all of the possible
        > characters one at a time. Can it be done? I haven't tried it
        yet 'cos
        > I'd sort of like to know whether its do-able beforehand.
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.