• Notepad++ fault; deleted entire content of my file

    Locked
    2
  • spelling verification in comments ?

    Locked
    5
    0 Votes
    5 Posts
    2k Views
    Jean-Yves BretonJ

    You’re right, i confused the two elements. Now I downloaded the french dictionary for DSpellCheck, choosed the French option in its menu option, and now everything works fine. Thank you very much!

  • How to find lines with words that are Capitalised

    Locked
    2
    0 Votes
    2 Posts
    5k Views
    PeterJonesP

    Let’s see if I can beat @guy038 to it:

    As a first pass, assuming one sentence per line (every line is defined as a sentence, and only one sentence per line). Also assume we aren’t requiring upper-case as the first character in the line

    Find What: (?-is)^.+[A-Z].*\R Replace With: `` (empty)

    Source Document:

    Keep this line. Hello, my name is Inigo Montoya, prepare to delete this line. This is okay. Delete me, Yoda shall. starting lowercase is okay, too but not if there's a Capital

    Final:

    Keep this line. This is okay. starting lowercase is okay, too

    Explanation:

    (?-is) = make it case sensitive; don’t span multiple lines ^ = start match at beginning of the line .+ = allow 1 or more of any character (this means that it won’t care if the first letter is upper case, because that will be taken up by the “allow 1”) [A-Z] = require one capital letter somewhere not in the first character .* = allow 0 or more any-character after the required capital letter \R = include the newline (either CRLF or just LF) in the match If all that matches, then replace with blank (since replacing the newline also, the whole line is deleted)

    However, this will not work when there are multiline sentences, or if you have multiple sentences in a line

    Multiline sentence won't work, because it will assume Previous Line is okay, even though this has capital, and the second line of this sentence will delete, but not the first or third. Multiple sentences won't work. Defining end of sentence is harder. Some People use period-two-spaces, and some only period-space. And how do you want to handle Mr. John Doe? Or sentences that "end inside the quote." And this becomes a Second sentence

    If you want more than the assumptions I made above, you will have to give a lot more details, and you may have to accept that you need a more intelligent parser than just a readable regex. (@guy038 may be able to get all of the edge cases in one regex, depending on what your rules are… but it will be a lot more complex than the one I showed…)

  • Colorization bug in XML

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    Thibault CastelT

    Thank you! I’ll wait the next release :)

  • How to fold part of a line?

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    prehistoric-penguinP

    Thanks a lot!

  • Make the Preferences Window a bit taller?

    2
  • Hi I stuck with row and columns

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    guy038G

    Hello, @notepadplusplusisthebest,

    Very easily, indeed !

    Open the Replace dialog ( Ctrl + H )

    SEARCH .{6}

    REPLACE $0\r\n

    OPTIONS Regular expression ticked and . matches newline unticked

    ACTION : Click on the Replace All button or several ones on the Replace button

    Remark : If you’re using Unix files, the REPLACE regex should be $0\n

    An other example . Suppose the line, below :

    ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9

    then the regex S/R :

    SEARCH .{5}

    REPLACE $0\r\n

    Would change that line into :

    ----+ ----1 ----+ ----2 ----+ ----3 ----+ ----4 ----+ ----5 ----+ ----6 ----+ ----7 ----+ ----8 ----+ ----9

    Best Regards

    guy038

  • Python 3.6 f-string variable highlighting

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Version format

    Locked
    1
    0 Votes
    1 Posts
    782 Views
    No one has replied
  • 0 Votes
    3 Posts
    1k Views
    Stavros SkamagkisS

    Yes, I tried the default programs applet but Notepad++ isn’t in the list of programs.

  • New Instance

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Claudia FrankC

    @Karttegayen-Nachimuthu

    afaik not and doesn’t that mean it is the same as just open another npp instance?
    Isn’t it quicker to click on the npp shortcut instead of clicking file->new?

    Cheers
    Claudia

  • how to highlight selected text with rgb color?

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    @RScream1

    interesting - could be done more or less but you need to be aware that you need
    to install a scripting plugin like python or lua … (one which exposes the scintilla features) and
    depending whether you want to use it together with a lexer (code highlighting from language menu)
    or not you do have just a couple of possible styles or indicators you can use.

    Let me know if you wanna go this way.

    Cheers
    Claudia

  • Regex to change numbers to a value 1 step lower

    Locked
    2
    0 Votes
    2 Posts
    3k Views
    guy038G

    Hello, @pablo-martinez,

    I’ve just missed your post, till now ! Really easy, indeed !

    The search regex is unchanged (0)|(1)|(2)|(3)|(4)|(5)|(6)|(7)|(8)|(9)

    The replacement regex becomes (?{1}9)(?{2}0)(?{3}1)(?{4}2)(?{5}3)(?{6}4)(?{7}5)(?{8}6)(?{9}7)(?{10}8)

    Remark : I noticed that, in your previous regex, when you add 1 to digit 9, you get the 0 digit ( part (?{10}0), at the end of your previous replacement regex ).

    So, to stay coherent, with that method, now, if you subtract 1 from 0, you’ll get the number 9 ( part (?{1}9), at the beginning of the new replacement regex ! )

    Best Regards,

    guy038

  • Web site

    Locked
    2
    -1 Votes
    2 Posts
    1k Views
    Claudia FrankC

    @Pierre-Namikaze

    By learning the “web” language of your choice and
    understanding what needs to be done to set up a webpage.

    Good starting points are
    https://www.w3schools.com/default.asp
    and
    https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_web_server

    Cheers
    Claudia

  • Messed up my settings. Help.

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Claudia FrankC

    @Don-Bonnenfant

    depending on your usage and configuration you need to do different actions.
    If you use a customized theme/style then you need to download a zipped npp version
    and extract the theme into your installation. If you use the the default theme/style then
    you can rename the file stylers.xml, which is either in your installation directory or under
    %APPDATA%, and then start npp. The file will be recreated with the default settings.

    Cheers
    Claudia

  • leave each Nth line, if contains .... (in script)

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    Claudia FrankC

    @Gonen-Shoham

    in addition to what Guy already mentioned, it would be good to know what kind of
    scripting language you are thinking of.

    Cheers
    Claudia

  • Formatting options in Notepad++

    Locked
    2
    0 Votes
    2 Posts
    11k Views
    Claudia FrankC

    @Suhas-kashyap-R.R

    You can make it work but you need to understand that this isn’t a persistent change which means
    if you close and reopen the file, the changes are gone. This is related to the fact that npp is a text
    editor and unlike word processors like MS Word, LibreOffice Writer it doesn’t save formatting
    information within the file. The coloring you see for programming languages like c/c++, python …
    are done on the fly and as already said, don’t persist on reload.

    So if you are still interested, then a possible solution might be to install python script plugin and
    define your own styles for different kind of actions.

    Cheers
    Claudia

  • Help with Regex to delete a block in paragraph/line

    Locked
    6
    0 Votes
    6 Posts
    3k Views
    du pD

    @guy038
    Thank you for the thorough explanation

    (?-si)<block.*?> works better than expected for me, even when inside the <block…> exceed 20 characters.

  • Trying to edit a read only file

    Locked
    3
    1 Votes
    3 Posts
    2k Views
    guy038G

    Hello, @kim-beach and All,

    May be I’m wrong but I’ll give a try !

    The coloured icon, at the left of the file name, in tabs, may be :

    Blue, if it refers to a saved file, which has not been modified, since that time

    Red, if it refers to a modified file, which has not been saved, since that time

    Grey, if it refers to a file, with the N++ temporary flag Read-Only “ON” ( See the option Edit > Set Read-Only )

    Just note that this N++ option is independent from the classical Read-Only flag of Windows. This N++ option is cancelled, as soon as you close the file or Notepad++. It just stays active, during the current N++ session, and prevents you for modifying the file, in any way !

    I hope that it’s related to your problem !

    Best Regards,

    guy038

  • How to display only rows that contain the number "300000"

    Locked
    3
    0 Votes
    3 Posts
    17k Views
    guy038G

    Hello, @djmcg, @scott-sumner and All,

    I said, in that other post, below, that finding all files, which do not contain a specific string, was not easy, with our Boost regex engine and that we need to use a work-around to get the right results. However, we can easily build a regex which find all lines of files, which do not contain a specific string ! And, then, delete them, as and when :-))

    https://notepad-plus-plus.org/community/topic/14870/regex-find-all-files-that-do-not-contain-some-words/2

    In your example, this specific string seems to be the number 300000, preceded by a semicolon

    So, the regex S/R, below, should keep only lines containing the string ;300000 :

    SEARCH (?-s)(?!.*;300000)^.*\R

    REPLACE Leave EMPTY

    OPTIONS Regular expression and Wrap around checked

    => It remains, only lines that contain the string ;300000. Et voilà !

    Notes :

    The first part (?-s) modifier means that dot will match any standard character, only and NOT the line breaks

    The last part ^.*\R is the range of characters to search for, that is to say, all characters of a line, even empty, along with its End of Line character(s)

    And, thanks to the middle part (?!.*;300000), which is a negative look-ahead, this search will be true, ONLY IF the string ;300000 cannot be found, from beginning of line, in the current line scanned

    And, as the Replacement part is empty, these lines are simply deleted

    As you see, you’ve got 4 solutions, to get the job done :

    With the LineFilter2 plugin

    With bookmarks

    With the Find result panel

    With regex S/R

    Enjoy N++ !!

    Cheers,

    guy038