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

Possible to remove the space character as a delimiter in a syntax file?

Expand Messages
  • Neal
    Is there a way to remove the space character as a delimiter in an edit plus syntax file? I am trying to highlight text in the following form (the names of the
    Message 1 of 3 , Oct 2, 2006
    • 0 Attachment
      Is there a way to remove the space character as a delimiter in an edit
      plus syntax file? I am trying to highlight text in the following form
      (the names of the colors are just for highlighting purposes... the
      text could be anything):

      yellow = blue

      or:

      yellow=blue

      I can get the 2nd entry to work. But if there is a space after the
      "=" the text doesnt highlight blue because the syntax file treats
      spaces as a delimiter.

      " #DELIMITER=
      Specify delimiters for parsing keywords. You don't need to specify
      the space character and the tab character here, since those are
      treated as delimiters by default."

      Here is my syntax file:

      #TITLE=Properties
      #DELIMITER=,(){}[]+%="'~!&|:;
      #QUOTATION1='
      #QUOTATION2="
      #CONTINUE_QUOTE=n
      #LINECOMMENT=#
      #CASE=n
      #PREFIX1==
      #KEYWORD=Reserved words
      #KEYWORD=Symbols
      =
      #

      I have tried "= " as a Prefix as well... no luck. Any ideas? Thank you.
    • DZ-Jay
      Hello: Whitespace characters are the de facto word delimiters, they are precisely what make words atomic units, so you won t be able to prevent that from
      Message 2 of 3 , Oct 3, 2006
      • 0 Attachment
        Hello:
        Whitespace characters are the de facto word delimiters, they are
        precisely what make words atomic units, so you won't be able to prevent
        that from happening.

        However, I'm thinking there must be an easier way to do what you are
        trying to do. What is the primary purpose in highlighting the entire
        "key=value" string? Perhaps you can construct a regular expression in
        the "Find" dialog which will detect the whole string, with spaces and
        all, and then its just a matter of hitting F3 to select the next one,
        instead of double-clicking.

        Here's a simple regular expression that may help you:

        [^= ]+ *= *[^ ]

        That will select any character that is not an equal-sign or a space,
        followed by an equal-sign (surrounded possibly by any number of
        spaces), followed by any non-space character (pressumably a word
        character). You should, of course, add any other delimiter characters
        to the [ ] ranges so that they are not included.

        I hope this helps.
        dZ.

        On Oct 2, 2006, at 18:17, Neal wrote:

        > Is there a way to remove the space character as a delimiter in an edit
        > plus syntax file? I am trying to highlight text in the following form
        > (the names of the colors are just for highlighting purposes... the
        > text could be anything):
        >
        > yellow = blue
        >
        > or:
        >
        > yellow=blue
        >
        > I can get the 2nd entry to work. But if there is a space after the
        > "=" the text doesnt highlight blue because the syntax file treats
        > spaces as a delimiter.
        >
        > " #DELIMITER=
        > Specify delimiters for parsing keywords. You don't need to specify
        > the space character and the tab character here, since those are
        > treated as delimiters by default."
        >
        > Here is my syntax file:
        >
        > #TITLE=Properties
        > #DELIMITER=,(){}[]+%="'~!&|:;
        > #QUOTATION1='
        > #QUOTATION2="
        > #CONTINUE_QUOTE=n
        > #LINECOMMENT=#
        > #CASE=n
        > #PREFIX1==
        > #KEYWORD=Reserved words
        > #KEYWORD=Symbols
        > =
        > #
        >
        > I have tried "= " as a Prefix as well... no luck. Any ideas? Thank
        > you.
        >
        >
        >
        >
        >
        >
        >
        >
        > http://www.editplus.com
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
      • Dean Householder
        Wouldn t you need a + at the end of the string to match a whole word? [^= ]+ *= *[^ ]+ Dean ... [Non-text portions of this message have been removed]
        Message 3 of 3 , Oct 3, 2006
        • 0 Attachment
          Wouldn't you need a + at the end of the string to match a whole word?

          [^= ]+ *= *[^ ]+

          Dean


          DZ-Jay wrote:
          >
          > Hello:
          > Whitespace characters are the de facto word delimiters, they are
          > precisely what make words atomic units, so you won't be able to prevent
          > that from happening.
          >
          > However, I'm thinking there must be an easier way to do what you are
          > trying to do. What is the primary purpose in highlighting the entire
          > "key=value" string? Perhaps you can construct a regular expression in
          > the "Find" dialog which will detect the whole string, with spaces and
          > all, and then its just a matter of hitting F3 to select the next one,
          > instead of double-clicking.
          >
          > Here's a simple regular expression that may help you:
          >
          > [^= ]+ *= *[^ ]
          >
          > That will select any character that is not an equal-sign or a space,
          > followed by an equal-sign (surrounded possibly by any number of
          > spaces), followed by any non-space character (pressumably a word
          > character). You should, of course, add any other delimiter characters
          > to the [ ] ranges so that they are not included.
          >
          > I hope this helps.
          > dZ.
          >
          > On Oct 2, 2006, at 18:17, Neal wrote:
          >
          > > Is there a way to remove the space character as a delimiter in an edit
          > > plus syntax file? I am trying to highlight text in the following form
          > > (the names of the colors are just for highlighting purposes... the
          > > text could be anything):
          > >
          > > yellow = blue
          > >
          > > or:
          > >
          > > yellow=blue
          > >
          > > I can get the 2nd entry to work. But if there is a space after the
          > > "=" the text doesnt highlight blue because the syntax file treats
          > > spaces as a delimiter.
          > >
          > > " #DELIMITER=
          > > Specify delimiters for parsing keywords. You don't need to specify
          > > the space character and the tab character here, since those are
          > > treated as delimiters by default."
          > >
          > > Here is my syntax file:
          > >
          > > #TITLE=Properties
          > > #DELIMITER=,(){}[]+%="'~!&|:;
          > > #QUOTATION1='
          > > #QUOTATION2="
          > > #CONTINUE_QUOTE=n
          > > #LINECOMMENT=#
          > > #CASE=n
          > > #PREFIX1==
          > > #KEYWORD=Reserved words
          > > #KEYWORD=Symbols
          > > =
          > > #
          > >
          > > I have tried "= " as a Prefix as well... no luck. Any ideas? Thank
          > > you.
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > > http://www.editplus.com <http://www.editplus.com>
          > > Yahoo! Groups Links
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          > >
          >
          >


          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.