Special color methods for syntax highlighting log files

Special color methods for syntax highlighting log files

7
NewbieNewbie
7

    Mar 14, 2014#1

    I am worried that this is a question with an obvious answer, but I have searched, read, and tested and I am still confused.

    I have a set of text files I use for organizing my life. Lately, after too long, I have started including some special syntax highlighting to help me. So my questions do not regard any programming language.

    What I would like to be able to do is to define a set of special characters (| + = *, etc.) and then also matching characters ({}, [], etc.) and be able to define them all as having different Color Groups. The colors should apply to any text between the special characters or brackets, or in other cases to the end of the line (like a line comment).

    So far I seem to only be able to accomplish some of this. For instance, in the GUI I can set a Color Group for Alternate Block Comments, but not for just plain Block Comments. I want to have a different set of colors for each special character.

    Is this possible?

    6,681583
    Grand MasterGrand Master
    6,681583

      Mar 14, 2014#2

      The only features supporting highlighting a block over multiple lines are strings, block comments and alternate block comments.

      Strings can be highlighted over multiple lines by using keyword EnableMLS in first line of the wordfile left to File Extensions =. Up to 2 string characters can be defined, usual is String Chars = "'. And by putting one of those 2 characters into a separate color group, it is possible to use 2 different colors for the strings.

      Block comments share the color with line comments and alternate line comments. So it might not be useful for you as you can use only one of them. The alternate block comments have a separate color setting and can be used in your case.

      To highlighting something on same line between two characters there is /Marker Characters =. Up to 4 pairs of marker characters can be specified. By putting each marker character pair into its own color group like a word, the strings between 2, 4, 6 or 8 characters are highlighted with the 1, 2, 3 or 4 different colors.

      The page Syntax Highlighting in help of UltraEdit as well as the template for syntax highlighting language wordfile contain details about what I listed here.

      So in total it is possible to highlight strings including word delimiters like spaces, tabs and others with up to 8 different colors whereby 4 can be multi-line strings and 4 can be only single line strings.
      Best regards from an UC/UE/UES for Windows user from Austria

      7
      NewbieNewbie
      7

        Mar 14, 2014#3

        Thank you for your prompt reply. I have read your reply closely and reread the page you linked (I had seen it before), but while I am a little smarter, I am still confused. I apologize if I am being really brain dead here.

        First, I have absolutely no need for multi-line highlighting, so actually I am using DisableMLS.

        It seems that Marker Characters may be what I need, but I cannot figure out how to assign a pair of characters to their own color group.

        Here would be an example of what I would want:
        *Color Group 1 from Asterisk to End of Line
        =Color Group 2 from equal sign to End of Line
        {Color Group 3 Between Braces}
        [Color Group 4 Between Brackets]
        +Color Group 5 Between Plus Signs+

        I would like to define as many color groups as possible using one character (and highlighting to the end of the line) or pair of characters (and highlighting the text between them). As in the example above, the character pairs might be the same or different characters. And as I said before, everything would be on the same line. Right now I can only figure out how to get three different color groups working: Comments, Alt Block Comments and Strings.

        If it matters, I do not want to use quotes, double quotes or parentheses to mean anything special.

        6,681583
        Grand MasterGrand Master
        6,681583

          Mar 14, 2014#4

          To highlight the 8 lines of this block with 8 different colors

          Code: Select all

          *Asterisk to end of line highlighted as line comment
          #Hash to end of line highlighted as alternate block comment defined as line comment 
          =Equal sign to end of line or another equal sign highlighted as single line string 
          |Pipe to end of line or another pipe highlighted with color group 1 as second type of a single line string
          {Color group 2 for strings between braces highlighted using first marker character pair}
          [Color group 3 for strings between square brackets highlighted using second marker character pair]
          +Color group 4 for strings between 2 plus signs highlighted using third marker character pair+
          ,Color group 5 for strings between 2 commas highlighted using fourth and last marker character pair,
          you would new a wordfile containing the block

          Code: Select all

          /L20"Example" Nocase Line Comment = * Block Comment On Alt = # String Chars = =| DisableMLS File Extensions = LOG
          /Delimiters = * +	,=[]{|}
          /Marker Characters = "{}[]++,,"
          /C1"Lines with pipes"
          |
          /C2"Lines with braces"
          {}
          /C3"Lines with square brackets"
          []
          /C4"Lines with plus signs"
          ++
          /C5"Lines with commas"
          ,,
          The delimiters with a tab character between the plus sign and the comma are not really important for the highlighting of the 8 lines, but it makes nevertheless sense to specify those characters as word delimiters.

          MLS in DisableMLS and EnableMLS does not mean multi-language support. I do not know where you read this. MLS means multi-line strings. And DisableMLS is very important here to use the 2 string chars as pseudo line comments.
          Best regards from an UC/UE/UES for Windows user from Austria