Find one word and other not present in the line

Find one word and other not present in the line

4
NewbieNewbie
4

    Sep 08, 2004#1

    I want to find all the lines that have the text '<td' and that not have 'class'. How can I do?

    That is, I want to find lines like:

    <td>
    <td style=''>

    but not lines like:

    <td width='' class=''>
    <td class=''>

    Thanks. :)

    6,603548
    Grand MasterGrand Master
    6,603548

      Sep 09, 2004#2

      What you want is not possible with a single regular expression search. UltraEdit has not feature to search for something, which does not contain some specified words.

      It would be useful, if IDM would add a new entry field in all find and replace dialogs, where users can specifiy words, which should not be part of a search result .

      For example:

      Find: <td*>
      Not: class

      So UltraEdit finds first "<td>", test if this search result contains "class" and because it is not in the result, the first search result is "<td>".

      Next UltraEdit finds "<td style='...'>", test if this search result contains "class" and because it is not in the result, the second search result is "<td style='...'>".

      Next UltraEdit finds "<td width='xx' class='...'>", test if this search result contains "class" and because it is in the result, this search result is ignored.

      Last UltraEdit finds "<td class='...'>", test if this search result contains "class" and because it is in the result, this search result is also ignored.

      What do you (all users of UE) think about this? Should I mail an feature request to IDM?

      --------

      As quick workaround for the problem is, that you could write a macro to search for <td*> and write the results to a new file and remove in a second step those lines, which contain the word class. Don't know, if this would be useful in your situation. I guess, it would not.
      Best regards from an UC/UE/UES for Windows user from Austria

      38
      Basic UserBasic User
      38

        Sep 09, 2004#3

        Sounds like a good suggestion.

        Dan
        Daniel Kirkdorffer
        http://www.kirkdorffer.com/

        4
        NewbieNewbie
        4

          Sep 10, 2004#4

          Thanks for the answer, Mofi. :)

          Mofi wrote: As quick workaround for the problem is, that you could write a macro to search for <td*> and write the results to a new file and remove in a second step those lines, which contain the word class. Don't know, if this would be useful in your situation. I guess, it would not.
          It sounds to complex, perhaps a C program will be more easy to do.

          I prefer your idea of request this feature to IDM. :))

          4
          NewbieNewbie
          4

            Dec 27, 2007#5

            gllanderas wrote:I want to find all the lines that have the text '<td' and that not have 'class'. How can I do?

            That is, I want to find lines like:

            <td>
            <td style=''>

            but not lines like:

            <td width='' class=''>
            <td class=''>

            Thanks. :)
            For perl style regular expression, can we do this:

            <td[[:alpha:]]*[^c][^l][^a][^s][^s]"=>