Community
    • Login

    Save REGEX

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 2 Posters 3.5k Views
    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.
    • Vasile CarausV
      Vasile Caraus
      last edited by

      hello, is there any option to save regular expressions in the notepad++ like in GrepWin or other text editors?

      1 Reply Last reply Reply Quote 0
      • guy038G
        guy038
        last edited by

        Hello, Vasile,

        I’m afraid that no native option exists, in N++ :-(( So, expect for the obvious idea to keep your list of favourite regexes in a text file, you should have a look to the config.xml file !

        Here is, below, the interesting section FindHistory, from my OWN config.xml file :

        <FindHistory nbMaxFindHistoryPath="10" nbMaxFindHistoryFilter="10" nbMaxFindHistoryFind="10" nbMaxFindHistoryReplace="10" matchWord="yes" matchCase="no" wrap="no" directionDown="yes" fifRecuisive="yes" fifInHiddenFolder="no" dlgAlwaysVisible="no" fifFilterFollowsDoc="no" fifFolderFollowsDoc="no" searchMode="2" transparencyMode="1" transparency="156" dotMatchesNewline="no">
                <Find name="(?-s)(^.*\R)\1+" />
                <Find name="\b(the|you|in)\b" />
                <Find name="^\d+A|(\R\d+B)" />
                <Find name="^\d+A" />
                <Find name="(?-i)^\d+A" />
                <Find name="(?-i)^\d+A|(\R\d+B)" />
                <Find name="\d+A|(\R\d+B)" />
                <Find name=" 106 " />
                <Find name="VK_PLUS" />
                <Find name="I love \w+ car" />
                <Replace name="\1" />
                <Replace name="?1\t" />
                <Replace name="(?1\t )" />
                <Replace name="abc$0xyz" />
                <Replace name="$0\r\n" />
                <Replace name="(?1\1)(?2 )" />
                <Replace name="(?1\1: )" />
                <Replace name="\1\r\n" />
                <Replace name="(?1n)(?2s)(?3w)(?4e)" />
                <Replace name="\1 \2 \3" />
            </FindHistory>
        

        I suppose that changing the nbMaxFindHistoryFind AND/OR the nbMaxFindHistoryReplace parameters, from the default number 10, would work :-)) I didn’t try it, yet, anyway !

        BEWARE: you must, preferably :

        • Close any instance of Notepad++

        • Open the config.xml file, with an OTHER editor than N++ ( Notepad, Wordpad, … ) , then save the changes

        • Re-start Notepad++

        Best Regards,

        guy038

        1 Reply Last reply Reply Quote 0
        • Vasile CarausV
          Vasile Caraus
          last edited by

          hello guy38. Yes, it’s ok. I wanted to save my special regex into notepad ++ so that not to open the file with all my regex expressions.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors