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

Re: [NTB] Re: Searching text for large list of keywords - how best?

Expand Messages
  • Theo Brueton
    At 21:10 30/09/03 -0000, hugo_paulissen wrote: I m not sure if this is what you are after but you could try it with ... Interesting! A string in the form
    Message 1 of 7 , Oct 1, 2003
    • 0 Attachment
      At 21:10 30/09/03 -0000, hugo_paulissen wrote:
      I'm not sure if this is what you are after but you could try it with
      >something like:
      >
      >\n*\w*(example1)|(example2)|(example3)|(example4)
      >
      >Apparently your construction with "\w(expr)|etc" chokes on the
      >trailing blank/new line character.

      Interesting!

      A string in the form following your suggestion, ie
      \n*\w*(expr)|(replace)|(example)
      doesn't "choke"; but it only finds matches occurring at the start
      of a line. Thus it seems that the * (match 0 or more) doesn't
      work as advertised here!

      However,
      ((\n)|(\w))(expr)|(replace)|(example)
      seems to produce the result I am looking for!

      (I don't understand the need for
      the inner brackets in ((\n)|(\w)) ]

      So, thank you very much Hugo!

      >Please note that the Regular
      >Expression-engine may cause hickups if you construct complex
      >expressions.

      Oh dear, is this a regular "feature"?

      I'm not sure that the expression I'm after is/should really be
      complex - I'm just trying to find matches with a list of keywords.
      (But unless you put a \w or similar at the beginning you'll generally get
      "false" matches, where a keyword forms part of a longer word)

      >It is always safe to make a backup first.

      Indeed.

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