Regexing the wordfile

Regexing the wordfile

9
NewbieNewbie
9

    Apr 15, 2009#1

    I would like to suggest a way to use regular expressions inside the /C1, /C2, /C3, etc. sections.

    The language we use most with our work is Foxpro, which notoriously reuses keywords.

    For example, "alias" is both a function and a flag for the "use" command.

    If I had all of my commands and flags the color green and my functions the color red, the following line would look kind of funky:

    Code: Select all

    use shared f:\salesdata\terms alias salesterms
    ? alias("salesterms")
    
    It currently looks like this, with the colors in brackets applying to the previous word:

    use shared f:\salesdata\terms alias salesterms
    ? alias("salesterms")


    Where I would want it too look like this:

    use shared f:\salesdata\terms alias salesterms
    ? alias("salesterms")


    If I were able to specify as the criteria in the /C section for commands:

    Code: Select all

    ^(use^)*^(shared^)*^(alias^)|^1 ^2 ^3
    
    it would work like I want it too.

    This requires giving the things that we want used in this regex, so I guess it would look similar to the replace section of the find and replace.
    In my example above, the part after the pipe (it wouldn't have to be a pipe!) would be what to highlight.


    Alternatively, if I wanted the flags to be a different color from the command, I could split the example into two /C sections.

    Code: Select all

    /C1"Commands"
    <color blue>
    ^(use^)*^(shared^)*^(alias^)|^1
    /C2"Flags"
    <color green>
    ^(use^)*^(shared^)*^(alias^)|^2 ^3
    /C3"Functions"
    <color red>
    ^(alias^)(
    
    This would give:

    use shared f:\salesdata\terms alias salesterms
    ? alias("salesterms")


    Also, I haven't seen how v15 does colors, but I've heard its in the wordfile. Please excuse my formating above for the colors.

    What does everyone think about this?

    (BTW: I submitted this as a suggestion to IDM today.)

    901
    MasterMaster
    901

      Jun 05, 2010#2

      I suggested to IDM that they implement regular expressions in their word file syntax definitions a couple years ago. I agree that it would be a welcome improvement over the current system. Thanks for suggesting it.

      9

        Apr 21, 2014#3

        This is still not possible, right? I know you can do this with Textmate. Would be neat to be able to define patterns that should be styled a certain way in UltraEdit, too.

        6,686585
        Grand MasterGrand Master
        6,686585

          Apr 22, 2014#4

          caserichard wrote:This is still not possible, right?
          Right. It is still not possible in currently latest version 21.10.0.1026 of UltraEdit to use regular expressions in syntax highlighting wordfile to define strings to highlight with a color.
          Best regards from an UC/UE/UES for Windows user from Austria