• Exception 'Division by zero' error on start

    Locked
    3
    0 Votes
    3 Posts
    981 Views
    PeterJonesP

    please see FAQ Desk: Request for Help without sufficient information to help you, then come back to this topic and give us enough information to help you.

    For what it’s worth, with NPP 7.5.8 32-bit installed or 64-bit standalone (both of which I’ve used frequently in the last couple days), I have not seen the problem you are describing. My guess is that it’s a plugin causing your issue… if you read the FAQ, and provide the ? > Debug Info, along with other relevant information, someone might be able to help you. But, as it is, all I can say is “it doesn’t happen for me”.

  • Need regex for incremental by 1

    Locked
    8
    0 Votes
    8 Posts
    11k Views
    Scott SumnerS

    @Vasile-Caraus

    It sure seems like you could use a variation on the technique described above:

    key concept: use Replace All in All Open Documents or Replace in Files for most of the action create a delimiter and a lookup-table running from 0 to 101 (or whatever), probably all on one line is best, e.g. \r\n-----0:1,1:2,2:3,3:4,4:5,5:6,6:7,7:8,8:9,9:10,10:11,… ; you can do this with the column-editor features to ease the pain…followed by some editing… regex replace \z in each file with the lookup table string created above (this will add the table at the end of each file) run a regex replacement (on all files) like described above for the other poster but customized for your data, e.g. \$item_id = \d+; and the contents of the lookup-table string craft another regex replacement to remove the delimiter and lookup-table from all files
  • Sorting lines evenly in document

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    Scott SumnerS

    @David-Talbot

    Although it doesn’t help with the fixed-interval distribution, these links might assist with doing some random “sorting”:

    https://notepad-plus-plus.org/community/topic/14129/sort-file-removing-duplicates-possible (this is a base link which doesn’t discuss random sorting per se, but it leads to the following link, which offers it as a feature)

    @Claudia-Frank 's “Sorter” Pythonscript: https://gist.github.com/ClaudiaFrank/3b5a346b86b5391c67f2f96845ff7ecd

    Really though, the OP is a rather specific and esoteric need…and that usually ends up with someone telling you to not depend upon Notepad++ being able to help, but rather grabbing a programming language of your choice and “having at it”.

  • Programming language not being saved.

    Locked
    2
    0 Votes
    2 Posts
    715 Views
    gstaviG

    Notepad++ is used to edit plain text files.
    A syntax highlighting lexer can be applied to the text file so it will be displayed with colors.
    Notepad++ tries to guess the appropriate lexer from the file extension. Usually it works since extensions are tightly coupled to language.
    If it does not then the lexer can be manually selected from the Language menu.
    In any case nothing related to Language is ever ‘saved’. Notepad++ only saves the file’s plain text. If your file’s extension is not associated to your desired language then you will have to manually select the language every time you open the file.

    If you need to add or fix file extension association to language it can be done from: Settings -> Style Configurator
    Select the language and observe: Default ext and User ext.

  • Deleting multiple lines that contain a certain text

    Locked
    6
    0 Votes
    6 Posts
    1k Views
    Terry RT

    Right, this time I tested it and I think this regex might achieve the correct result. Sorry about the false start. My mind on other matters.

    Find what: ^<passthrumac(?:.+\R){4}.+?>Guest01<(?:.+\R){2}</passthrumac>\R
    Replace with: empty field here <— nothing in this field
    So search mode is “regular Expresssion” and “wrap-around” ticked, nothing else.

    You mentioned Match Case. You could tick it if you ONLY want exactly the text portions as typed in the Find what field, so <passthrumac>, rather than say <PassThruMAC>, and Guest01 rather than guest01. Otherwise I’d leave it unticked.

    Again, sorry, have a go with this and let me know.

    This regex expects EXACTLY 7 lines, hence I removed the (?s) from the first incorrect one. So the lines must be in the same order as you show. That’s why I only check for >Guest01< rather then look for <username>Guest01</username>. So it cannot confuse Guest01 on that line instead of the following Guest01 with the Auto-added string in front.

    Terry

  • Is it possible to set and save style tokens in a notepad++ file?

    Locked
    2
    0 Votes
    2 Posts
    3k Views
    Scott SumnerS

    @Douglas-Kaynor said:

    Is it possible to set and save style tokens in a notepad++ file?

    Not currently, although if you are ambitious you can do it with some scripting

    possible future feature?

    You can ask; sure seems like this might have been requested before, try searching the issues list…

  • 2 Votes
    6 Posts
    14k Views
    PeterJonesP

    There is the old (read-only) Notepad++ Wiki: it’s years out-of-date, but some of the basic information is still useful. (For example, the Wrap around is mentioned briefly on the Searching And Replacing page.)

  • BUG: Normal Text always highlighted

    6
    1 Votes
    6 Posts
    7k Views
    Adam CorballyA

    Hello to anyone who may eventually run into the same problem. Like Mike said, the issue is the NPPCalc.dll plugin, but its not actually a bug, its a feature, activated when you press CTRL + SHIFT + C, which can only be disabled by pressing the button sequence again and changing tabs to force it to reload.

    Highly irregular, and its been plaguing me for years! Hopefully that helps someone else

  • Notepad++ 7.5.8 64bit is crashing while Printing initiates

    2
    0 Votes
    2 Posts
    2k Views
    Scott HamiltonS

    Likely duplicate of https://notepad-plus-plus.org/community/topic/16202/printing-issue; I have similar issue.

  • is the macros number limit to 200?

    Locked
    9
    1 Votes
    9 Posts
    2k Views
    imdjsI

    thank you I will try the “snippets” plugins.

  • Regex'pert' question remove SQL exported column

    Locked
    2
    0 Votes
    2 Posts
    789 Views
    Terry RT

    @compumatter, I’m not entirely sure whether you mean
    “I need to remove the first column of data and its comma” or
    “suggest the right replace code for turning x, into blank entry”.

    The first suggests deleting the number and it’s comma, the second suggests just replacing the number with a blank space.

    I’ll go with the first idea, completely removing the number and comma.
    So:
    Find what: ^(\()(\h*\d+,\h)
    Replace with: \1
    In the Replace window, have “regular expression” selected as well as “wrap around”. Clicking the “replace all” button will complete the changes in the entire file.

    I’m a bit concerned that the first 9 rows have the number against the (, then there is a space after the ( in the next 3 rows. Hence my regex has the \h* included. I’ve also included a following space so the “70” appears directly behind the (. This could be removed if it’s not essential the “70” is directly behind the (.

    This is a fairly easy regex to build, I suggest you read our FAQ, in particular “FAQ Desk: Where to find REGEX documentation ?” it contains lots of links to very good information, it will help get you started learning about regex.

    To start you off we have (description):
    ^ means the start of a line
    ( is the start of a group
    ( the \ is a delimiter, because the ( is a special character, so this means literally the (
    ) is the end of the group, so anything contained within this is captured
    ( is the start of another group
    \h* means as many spaces as exists including none
    \d+ means at 1 or more digits
    , is of course the comma, literally
    \h means 1 space which MUST exist. This could be a \h* if possibly no spaces exist in this position on some rows
    ) closing of the group

    \1 means the 1st captured group is returned. The 2nd captured group is what we want removed, hence it is not added to the replace field and is effectively deleted.

    Hope this helps

    Terry

  • After removal, notepad++ still opens standard text files by default

    Locked
    1
    0 Votes
    1 Posts
    420 Views
    No one has replied
  • 0 Votes
    2 Posts
    827 Views
    PeterJonesP

    It’s not a Notepad++ problem; it’s the way Windows handles Admin privilege.

    A first response in a web search gave a SuperUser.com question that seems relevant. Hopefully it will help you: https://superuser.com/questions/690287/command-prompt-in-administrator-mode-doesnt-see-mapped-drives

  • Saving a file as HTML

    Locked
    4
    0 Votes
    4 Posts
    1k Views
    Scott SumnerS

    @Dylan-van-Eeden

    I only select the .html in the SaveAs box!

    Well, as I tried to hint, that isn’t going to do it. All that does is to filter out anything but .html files from your view of already existing files. Here’s your bigger hint: If you are working on a file and you want it to be named abc.html then in the SaveAs box you will want to actually type abc.html.

  • Making Notetab++ the default app in Windows 10

    Locked
    2
    0 Votes
    2 Posts
    811 Views
    Scott SumnerS

    @John-McIntyre said:

    Click on the "(Unofficial) Notepad++

    UGH!
  • How to assign an unused shortcut?

    Locked
    3
    1 Votes
    3 Posts
    798 Views
    古旮

    Thanks for the reply. NPP 7.5.5 on my computer does behave as you say. I was using version 6.9.2 which doesn’t have his feature when posting this question. Problem solved.

  • NP++ "Loses its place" after being minimized or losing focus...

    Locked
    1
    0 Votes
    1 Posts
    566 Views
    No one has replied
  • How to find and highlight a specific occurance of a symbol?

    14
    0 Votes
    14 Posts
    5k Views
    Scott SumnerS

    @guy038 and @Terry-R :

    So after some thinking about this, I’ve decided that I don’t think the \A syntax is broken in Notepad++, and I don’t think that lookbehind assertions (either positive or negative) are broken in Notepad++ either. One just has to fully understand how Notepad++ searching works. And @guy038, in your post just above, where you talk about a “first problem” and a “second problem” and beyond…I have NO problem with how Notepad++ works in these cases, given my new thinking!

    Every Notepad++ search has a “starting-point” when the user initiates a search, or that Notepad++ itself initiates after a successful match in the case where one of the “find all” searches (or a Find in Files) is conducted. Each starting-point has exactly NOTHING before it. YOU may SEE data before your caret when you initiate a Find Next, but Notepad++ doesn’t. And that, IMO, isn’t necessarily a broken search feature, it is just “the way it works”. To Notepad++, each starting-point appears the same as a start-of-file does–no data (aka NOTHING) comes before it.

    At the beginning of your regex, an \A assertion or ANY valid negative lookbehind assertion will match the NOTHING right at a starting-point (i.e., that part of the regex will always succeed). Note that a negative lookbehind assertion doesn’t match the real data to the left of your caret, it matches the NOTHING. Example: Have 12345678 (only) in your buffer and your caret between the 4 and the 5. Do a regex search for (?<!4)5 and see that it matches the 5. The (?<!4) in this case allows the match because NOTHING is not 4. Some would call this regex behavior “broken”…because YOU the user can see the darned 4 right there!

    While a search is “in-progress” on a buffer, however, no one would call negative lookbehind assertions broken. Example: Use the same buffer as before but have your caret between the 1 and the 2. Do a regex search for (?<!4)5 and see that there is no match. In this case there is a 4 before the 5 (the search is “underway” at this point and Notepad++ is looking at the buffer…and this time the 4 is a part of that buffer) so the assertion fails the overall match.

    Side note: With “Wrap around” ticked during a search, if no match is found between the current caret point and the end-of-file, a second (internal) search is done by Notepad++, with a starting-point at the start-of-file. This is an additional opportunity for a match to happen at a “starting point”. For more info on the “2nd search”, see here…quite far into that thread… Although that thead discusses replacement, find a part of replacement, so it works the same way.

    So that brings us back to the regex under discussion: (?<!\r|\n)^.

    It will work like an “unbroken” \A in most cases. A possible problem with it comes when doing “multiple” searches with it (or when the user-starting-point isn’t the start-of-file). In those cases, if the previous action with it leaves the next starting-point at the start of any line, the next search will match right there – not only at start-of-file – which may not be what the user desires. (Again, it will match that case because the (?<!\r|\n) part will match the NOTHING and the ^ will hit).

    The best way to use it as an \A-equivalent is to have the end of your regex not leave the next starting-point at any start-of-line.

    So let’s go back to Terry’s original regex (or very close to it):

    (?s)(?<!\r|\n)^((.+?)===========){5}(.+?)\K(===========)

    When run on the OP’s sample data (duplicated a few times so that there are many more than 9 lines of =========== data) this will find exactly ONE match when a “find all” is done. That is because the end of the regex sets up the follow-on starting-point to NOT be able to match a start-of-line (needed by the ^ assertion).

    Changing the regex slightly at the end:

    (?s)(?<!\r|\n)^((.+?)===========){5}(.+?)\K(===========)\R

    This one will result in multiple matches using a “find all” in the OP’s (extended) data, for reasons which should now be apparent. Thus it is worth pointing out in such a case that the (?<!\r|\n)^ regex is NOT what one normally thinks \A should be doing. So while it can be a \A substitute, it still has to be used with some amount of caution, and of course, understanding. :-)

    Back to \A: You can be the judge of whether or not it is broken: The Boost documentation for \A says “Matches at the start of a buffer only” – does one consider the “buffer” to be the entirety of the Notepad++ editor tab data, or the starting-point(s) through a later point for a search? Your call. :-)

    And now onto \G. In this thread , there are 3 conditions specified for where the \G assertion can match. I believe there is only ONE place it can match; hint: the “starting-point” of a search. :-)

  • 0 Votes
    2 Posts
    943 Views
    Vitaliy DovganV

    It already works like you described in your feature request.
    I can only assume that double-clicking the find results may not work properly when you are working with remote files (e.g. via network, mapped network drive, FTP etc.) and there’s something wrong with getting the proper file path.

  • Add href expression as exeption

    Locked
    1
    1 Votes
    1 Posts
    527 Views
    No one has replied