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

Re: [NTB] find & replace with regular expressions

Expand Messages
  • Jason Waugh
    ... If you are using Regex, you don t want to be using ^P --- n is what you want to use. Here s a tip for using regex in Notetab: Anything you paste in the
    Message 1 of 10 , Dec 21, 2005
      On 12/21/05, Don Strack <donstrack@...> wrote:
      > Using the Help section in NoteTab pro, I've tried:
      > Find:
      > </td>^P<td>{.*}^P</td>^P</tr>^P<tr>
      > Replace:
      > </td>^P<td class="wrap">\1^P</td>^P</tr>^P<tr>
      > and it does not work.


      If you are using Regex, you don't want to be using ^P --- \n is what
      you want to use.

      Here's a tip for using regex in Notetab:
      Anything you paste in the "CTRL-F" find dialog box or "CTRL-R"
      find/replace dialog will be automatically converted to something
      regex-compatible if it's pasted in there while the regex box is
      checked.

      Select a sample of something you want to search... hit CTRL-F... if
      the regex box is checked, you'll notice all your ^P already show as
      \n. If not, then check the regex box and repaste into the "find"
      section. Now, it's just a matter of taking the bit of text you are
      looking to deal with and replacing with {.*}


      Now, for your particular problem, you want to put this in the find box:

      </td>\n<td>{.*}\n</td>\n</tr>\n<tr>

      And replace with:

      </td>\n<td class="nowrap">\1\n</td>\n</tr>\n<tr>

      However, please make sure in your find/replace dialog the "regex" box
      is UNCHECKED if you are going to paste these from the email right into
      the dialog. Check the regex after you have pasted (otherwise Notetab
      will regexify your already regexified text....)

      As for the HTML you're doing... doesn't seem right to me, and where's
      the indenting? For that, though, John's suggestion is correct - HTML
      discussion on the HTML list.

      Thanks,
      Jason Waugh
    • Don - htmlfixit.com
      Hi again John, It does work on the sample you sent through a while ago on my end, so there is something just a tich off in transfer. Email me a direct sample
      Message 2 of 10 , Dec 21, 2005
        Hi again John,

        It does work on the sample you sent through a while ago on my end, so
        there is something just a tich off in transfer. Email me a direct
        sample of your file if you are willing.

        I agree with John, we should move over to the html list if we continue.
        I'll copy this over there. Are you a member of that group?

        Start with just a find command only, forget the replace for a minute.
        You need to un-check regex before copying it in, and then check regex
        once it is there. I'll still save you the $159 before we are done :-)

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