Community
    • Login

    use notepad ++ to modify a wordlist

    Scheduled Pinned Locked Moved General Discussion
    6 Posts 5 Posters 4.1k 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.
    • Raccolta Giochi Pc ProfiloR
      Raccolta Giochi Pc Profilo
      last edited by

      hi as the title, I would like to modify a series of phrases and codes open with notepad ++, and keep the list only those phrases or codes greater than 9 characters.

      I found the “Replace” function, and this command:

      ^ [1-8] {1} $

      question:
      1-This does not work with all numbers why?
      2-To also erase the court that command phrases I have to give? Thanks?

      1 Reply Last reply Reply Quote 0
      • Raccolta Giochi Pc ProfiloR
        Raccolta Giochi Pc Profilo
        last edited by

        This is not the right syntax.This I delete virtually every sentence
        ^[1-7{qwertyuiopasdfghjklzxcvbnm}]{1,}$

        how can I set this array?

        1 Reply Last reply Reply Quote 0
        • Jim DaileyJ
          Jim Dailey
          last edited by

          @Raccolta-Giochi-Pc-Profilo If you would show an example of the text as it is and as it should look after the change, I’m sure @guy038 will show you how to do it with a proper regular expression! :-)

          1 Reply Last reply Reply Quote 0
          • Secret-HQS
            Secret-HQ
            last edited by

            Assuming each of the phrases/codes is on its own line in N++ with no leading or trailing spaces, this should find all those from one to eight characters:

            ^.{1,8}$

            The “.” means “any character” and the “{1,8}” means “anywhere from one to eight times.”

            If there are leading or trailing spaces, this might work as an alternative:

            \b.{1,8}\b

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

              Hello Raccolta Giochi Pc Profilo

              To delete any line of a file, included empty lines, which is smaller than 10 characters, just follow the few steps, below :

              • Move back to the very beginning of your file ( CTRL + Origin )

              • Open the Replace dialog ( CTRL + F )

              • Uncheck the . matches newline option , if necessary

              • Set the Regular expression search mode

              • In the Find what zone, type in ^.{0,9}\R

              • Leave the Replace with zone EMPTY

              • Click on the Replace All button

              Et voilà !

              Notes :

              • The dot . represent any standard character, different of End of Line character(s)

              • The {0,9} is a quantifier that means from 0 to 9 times the previous character ( the dot )

              • The \R syntax stands for any kind of End of Line character(s), that is to say :

                • The two Windows “End of Line” characters \r\n

                • The Unix “End of Line” character \n

                • The Old Mac “End of Line” character \r

              Best Regards,

              guy038

              P.S. :

              You’ll find good documentation, about the new Boost C++ Regex library, v1.55.0 ( similar to the PERL Regular Common Expressions, v1.48.0 ), used by Notepad++, since its 6.0 version, at the TWO addresses below :

              http://www.boost.org/doc/libs/1_48_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html

              http://www.boost.org/doc/libs/1_48_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html

              • The FIRST link explains the syntax, of regular expressions, in the SEARCH part

              • The SECOND link explains the syntax, of regular expressions, in the REPLACEMENT part

              You may, either, look for valuable informations, on the sites, below :

              http://www.regular-expressions.info

              http://www.rexegg.com

              http://perldoc.perl.org/perlre.html

              1 Reply Last reply Reply Quote 1
              • Chuck RobertsC
                Chuck Roberts
                last edited by

                To practice regular expressions go to http://www.regex101.com. You can sign up and store the regex you create, or store them in a public library visible to all users. It’s really neat! It explains every part of the regex for you and has a nice help facility. So it’s great for beginners and advanced regexers.

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