How to Select all chars between 2 html tags?

How to Select all chars between 2 html tags?

3
NewbieNewbie
3

    Jan 25, 2005#1

    Hey
    How to select all characters between 2 html table tags and then capitalize
    the first letter of each word. Likely I need a macro with a
    "reg-ex find/select" and then a simple F5 key?

    The exact tags are
    <tr><td>text in here</td><td>
    Want Output of
    <tr><td>Text In Here</td><td>

    Thank you'
    Sky'

    6,682583
    Grand MasterGrand Master
    6,682583

      Jan 25, 2005#2

      The following macro should do the job. It will not work correctly, if the column text contains '<' or '>', but this should be no problem, because for < and > as text the corresponding html entities should always be used.

      Attention! It also capitalize html entities, if the entities are not correct defined - & must be the word starting character and not a delimiter.

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      Loop
      Find RegExp "<td>[~<>]+</td>"
      IfFound
      ToCaps
      Else
      ExitLoop
      EndIf
      EndLoop
      Top
      Find MatchCase "<Td>"
      Replace All "<td>"
      Find MatchCase "</Td>"
      Replace All "</td>"
      Best regards from an UC/UE/UES for Windows user from Austria

      46
      Basic UserBasic User
      46

        Jan 25, 2005#3

        If the tag is ever <td>...</td>, use this macro

        Code: Select all

        InsertMode
        ColumnModeOff
        HexOff
        UnixReOn
        "~@#"
        Top
        Find "<td>"
        Key RIGHT ARROW
        Key LEFT ARROW
        StartSelect
        Find Select "</td>"
        Key Ctrl+LEFT ARROW
        Key Ctrl+LEFT ARROW
        Key Ctrl+LEFT ARROW
        ToCaps
        EndSelect
        Top
        Find "~@#"
        Delete
        

        3
        NewbieNewbie
        3

          Jan 30, 2005#4

          Thanks alot. Both did the trick!

          3
          NewbieNewbie
          3

            Jul 11, 2009#5

            I tried the above example onto mine but it didn't work.
            I am trying to select all text in between these 2 tags
            <td id="lyrics" "class="song_text">
            and
            </td>

            Trying to copy it and then select the whole page and then paste and then save the file. I tried this macro but it isn't working.

            Code: Select all

            InsertMode
            ColumnModeOff
            HexOff
            UnixReOff
            Find RegExp "^<td id="lyrics" "class="song_text"^>*^</td^>"
            Copy
            SelectAll
            Paste
            Save
            I know the 'copy' is wrong here. I also tried start select and end select but that didn't work either. Any help here please

            6,682583
            Grand MasterGrand Master
            6,682583

              Jul 12, 2009#6

              Looks like you are using an older version of UltraEdit where the most powerful regular expression engine - the Perl engine - is not available.

              There is no need to escape < and > with ^ because <> are not regular expression characters for the UltraEdit engine. But * means 0 or more characters except new line characters. So using * limits your search to single lines. If you want to select a block, use following macro:

              UnixReOff
              Find MatchCase "<td id="lyrics" "class="song_text">"
              IfFound
              StartSelect
              Find MatchCase Select "</td>"
              EndSelect
              EndIf
              Best regards from an UC/UE/UES for Windows user from Austria

              3
              NewbieNewbie
              3

                Jul 12, 2009#7

                thanks mofi it worked!!