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

[NTB] Re: innocence in regular expressions...

Expand Messages
  • hugo_paulissen
    My previous message didn t come through, I guess... ... In NoteTabPro a newline is indicated by the token ^P - in a regular expression you have to use another
    Message 1 of 4 , Mar 29, 2003
    • 0 Attachment
      My previous message didn't come through, I guess...

      > Some things are still unclear to me... E.g., what is the
      > difference between \r, \l and \n ? I've expected that I have
      > to insert a \r for the cariage return ^P. How can I see
      > which of these is in my document?

      In NoteTabPro a newline is indicated by the token ^P - in a regular
      expression you have to use another string (regular expression): \n
      (this stands for newline, which is short for \r\l). Normally you find
      a linebreak (using a regular expression) with \n. NoteTab Pro doesn't
      use \r nor \l.

      > \W stands for nonword delimiters (help says (mystical to me) "it's
      > equivalent to [^\t\s!"&()*+,-./:;<=>?@[\]^`{|}~]"). What is meant
      by a
      > _nonword_ delimiter and this expression in the help?

      It would have been similar to something similar to [a-z]+ (instead of
      \W+ if I knew your definition of "word".

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

      This means that any non-word delimiter matches either one of the

      Any non word delimiter finds all characters NOT in the list
      (indicated by [^regexp]

      [^a] would find ALL charachters except a.

      > Is it possible to modify the expression {\n\t\t}{\W+}\s{\W+}\s\&
      > to replace one, two *or* three words?

      This is not too easy with the current regexp engine, but it could be
      done. You would have to use alternation to do that. And you have to
      group the parts that should be alternated. Please note that the order
      is important.

      Suppose your document consists of "a aa aaa"
      (a)|(aa)|(aaa) matches every single a
      (aaa)|(aa)|(a) matches a, aa and aaa

      The normal way to look for repetitions of the same regular expression
      is to add +, but this only distinguishes between one or MORE...

      > If the reg.exp. box is checked and I copy expressions from any
      program into
      > the reg.exp. box it adds lots of backslashes. What is the use of

      If you copy a complex string, the string is converted into a regular
      expression pattern. This helps you in building more complex regular
      expressions, although it sometimes is confusing. From help: You can
      bypass this conversion feature by holding down the Insert key while
      you paste the criteria in the field.

      Read the help-topic on the find dialog box (if that is open, just hit

    Your message has been successfully submitted and would be delivered to recipients shortly.