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

[NH] What else? Regular Expressions

Expand Messages
  • Charles A. Brannon
    ... Here are a few things to try before pulling out the sledge hammer: o When viewing a given file to find the pattern, be sure to turn word wrap off (CTRL-W).
    Message 1 of 1 , Feb 3, 2000
    • 0 Attachment
      --- Dennis Partridge <partridge@...> wrote:
      > It must search across multiple lines. This does
      > appear to be the problem

      > ><p align="center"><!--webbot bot="HTMLMarkup" startspan
      > >--><!--banner-->.*<!--banner--><!--webbot bot="HTMLMarkup" endspan --></p>
      > >

      Here are a few things to try before pulling out the sledge hammer:

      o When viewing a given file to find the pattern, be sure to turn word wrap off
      (CTRL-W). You don't want your accuracy skewed by screen display problems.

      o Open several files and try to determine if the CR/LF pattern is the same
      across all the files.

      - If so, great! Highlight the pattern with the mouse, copy and paste it
      into the Reg. Expr. box of the Search Text dialog (search disk). In this box,
      be sure to replace the variable text with the regex /.*/ (no slashes). The
      CR/LF should come out as ^P auto-magically by NoteTab (thanks, EF).

      - If not (gag!), see if the CR/LF is only between bracket pairs (>^P<). If
      so, you would replace each pair in your regex with the pattern />[ ^p^t]*</
      which allows for (almost!) unlimited CR/LF between brackets (with other white
      space thrown in for good measure).

      o If the above all fails, you may just want to follow the last point and also
      replace EVERY white space character in your search pattern (which would be /[
      ^p^t][ ^p^t]*/, be sure to repeat the class twice) with the new search pattern
      stated above (/[ ^p^t]*/). The result would allow for unlimited white space
      between tags and their attributes, hopefully catching everything you want to
      replace (or delete as the case may be).

      NOTES:
      o Be sure your search string is less than one kilobyte. I've managed to crash
      NoteTab several times with string greater than this, though I do not know the
      exact size that is 'too big'.
      o A regular expression is usually written between slash pairs (/regex/). I
      have done this here for clarity. In NoteTab the regex is indicated merely by
      checking the appropriate box.
      o The worst case scenario would be having to replace all white space with its
      own expression, but it may be so. The following *untested* expression should
      address all cases. Bes sure the space comes out int the classes ([ ^p^t]).
      Please let me know if it works!


      ----------------- the following is ONE complete line -----------------
      <p[ ^p^t][ ^p^t]*align="center">[ ^p^t]*<!--webbot[ ^p^t][
      ^p^t]*bot="HTMLMarkup"[ ^p^t][ ^p^t]*startspan-->[
      ^p^t]*<!--banner-->.*<!--banner-->[ ^p^t]*<!--webbot[ ^p^t][
      ^p^t]*bot="HTMLMarkup"[ ^p^t][ ^p^t]*endspan[ ^p^t][ ^p^t]*-->[ ^p^t]*</p>
      ----------------- the preceding is ONE complete line -----------------

      __________________________________________________
      Do You Yahoo!?
      Talk to your friends online with Yahoo! Messenger.
      http://im.yahoo.com
    Your message has been successfully submitted and would be delivered to recipients shortly.