Community
    • Login

    Highlight keyword followed by space

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 583 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      Galizza1
      last edited by Galizza1

      Hi, i like to know how i can configure Notepad++ to highlight in red any keyword that is followed by a space. This is an example of this highlight.

      For this example _ = Space

      Keyword                  No highlighted   
      Keyword,                 No highlighted
      Keyword,_AAAA            No highlighted
      Keyword_                 Red highlighted
      Keyword_AAAA             Red highlighted
      
      

      So any keyword followed by a space will be always highlighted in red color. I hope i explained myself properly, thanks

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP Offline
        PeterJones @Galizza1
        last edited by

        @Galizza1 ,

        You might want to give EnhanceAnyLexer plugin a try. You could set up a regex that looks for one of your keywords followed by a space, and changes the foreground color.

        plain text file:

            Bright Empires  2018
            Byzantium       2017
            Celtic Crusades 2017
            Avalon          2015
            Pendragon       2014
        

        EnhanceAnyLexer excerpt:

        [normal text]
        0x0000FF = (Pendragon|Crusade|Empires)\x20
        

        cbf26475-020e-4fd9-8868-34a614cceb6a-image.png

        “Pendragon” and “Empires” are highlighted red because the regex (which uses \x20 to indicate the trailing space) match, but the Crusades doesn’t match because there isn’t a space after the e

        G 1 Reply Last reply Reply Quote 2
        • G Offline
          Galizza1 @PeterJones
          last edited by

          @PeterJones

          Thanks

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors