• 2 Votes
    21 Posts
    3k Views
    Alan KilbornA

    @guy038 said:

    the site’s ability to highlight any sub-section of the regex in green is really awesome

    https://jmrware.com/articles/2010/dynregexhl/DynamicRegexHighlighter.html

  • 0 Votes
    4 Posts
    385 Views
    Евгений КЕ

    @PeterJones said in Regex find and replace string in different types of brackets:

    @Евгений-К ,

    One way to do it simultaneously is

    FIND = (>Some String<)|("Some String")
    REPLACE = (?1>New String<)(?2"New String")
    SEARCH MODE = Regular Expression

    But that’s “annoying” because you have to repeat the Some String and New String in the FIND and REPLACE.

    There are some fancy tricks using capture groups, either named or numbered, and control-flow assertions, to make sure that things balance correctly, and it will only match .

    FIND = (?'startwrap'(?'angled'>)|(?'quoted'"))\KSome String(?'endwrap'(?=(?('quoted')")(?('angled')<)))
    REPLACE = New String
    SEARCH MODE = Regular expression

    But as you can see, the FIND becomes rather complicated to save the “expense” of having Some String and New String twice. (You could theoretically do it with numbered capture groups instead, but getting the counts right, especially as you edit to make a third pair like {Some String}, would cause problems, so I used named groups so there was no ambiguity in the future. I will leave the “numbered group” version as an exercise to the interested reader.)

    So that’s two ways. Which is best depends on which you understand, and whether it’s going to be expanded in the future and/or done often. The most important thing with regex is that you understand what it’s doing, so that you don’t mess up your data.

    If you don’t understand a “single regex version” but can get it done in two simple search-and-replace that you fully understand, then two simple is probably better for you. (If it’s something you will be doing often, you can record the two search-and-replace into a macro, so that you can just play that macro in the future.)

    @PeterJones, thank you very much for your advice!
    I look at the options you suggested and once again I am convinced that RegEx was definitely not created by people and not for people :):):)
    Way #1 (captured group) is absolutely clear to me. I myself thought that it was necessary to act somehow through the groups, but I could not understand how.

    And as you correctly noted - this way in terms of labor costs is not much more efficient than the method without RegEx. The old and new lines have to be written twice.

    The second way is also clear to me, but only in general terms. This option is a very good warm-up for the mind. And I will definitely save this option for the future.

  • Find/Replace Window blocking results ...

    General Discussion
    11
    1 Votes
    11 Posts
    1k Views
    M

    Replace was where I was having the issue and it brings up some challenges that Find does not - basically, you would need a shortcut for “Ignore and Find Next” and one for “Replace and Find Next” and you’d have to remember those shortcuts.

    @Coises; TBH, now that I’ve learned to resize the screen. I’m okay with it. I think most users have multiple monitors these days and use the find/replace dialog on the second monitor.

    @Coises and @mkupper - I wasn’t aware of the caret button to move the dialog to two lines. I think that and an OPTION to dock the find dialog in the lower-right corner so I don’t have to re-size the screen would be perfect for what I want.

    Again - none of this addresses the context issue - which isn’t a primary concern of mine, but I still think it should be accommodated, if possible.

  • 0 Votes
    2 Posts
    395 Views
    PeterJonesP

    @Ling-Ling ,

    When you install Notepad++, it installs the right-click context-menu entry using a “Shell Extension”. The User Manual has an entire page on the Shell Extension, including a secion on how to unregister the Shell Extension so that the “Edit with Notepad++” entry goes away

  • 0 Votes
    18 Posts
    11k Views
    guy038G

    Hello, @alan-kilborn, and All,

    Alan, you’ve just understood all my stuff quite correctly and even more regarding your last example with $+{Test} and $+{foo}, whose I did not think of !

    Best Regards,

    guy038

  • Translation plugin

    Translation
    13
    0 Votes
    13 Posts
    5k Views
    conky77C

    I update the list of translatable plugins (NPP menuSearch is also translatable);
    At the moment the translatable plugins are:

    Hex editor available in German https://github.com/chcg/NPP_HexEdit/tree/master/HexEditor/lang https://github.com/chcg/NPP_HexEdit/tree/master/NativeLang/src/lang Multireplace available in Danish, French, German, Hungarian, Italian, Portuguese, Russian, Spanish, Ukrainian json tool available in Italian, Arabic, Chinese,French, German, Italian, Japanese, Korean, Twaiwanist NppMenuSearch available in German, Italian
  • 0 Votes
    2 Posts
    335 Views
    PeterJonesP

    @Aria-James,

    Recommended plugins for C/C++ syntax highlighting, auto-indentation, or even code suggestions for Arduino.

    Syntax highlighting occurs without plugins in Notepad++. You can set Settings > Style Configurator > Language: C++ to have user ext.: = ino so that Arduino sketches automatically get associated with C++ language.

    Further, you can set the USER KEYWORDS # > user-defined-keywords per my post here to add the Arduino-specific keywords to the syntax highlighter.

    Notepad++ does some auto-indentation natively: see Settings > Preferences > Indentation > Indent Settings = cpp to control tabs-vs-spaces on a per-language basis, and the Auto-indent = basic vs advanced which applies globally throughout Notepad++ (described in more detail here in the User Manual). But it’s not super-fancy, and is only “as you add new lines”, so it won’t clean previous code. @Michael-Vincent shares an example script for the NppExec plugin that is able to run an external “pretty print” utility for multiple languages depending on file extension in this post: his script does it for C, HTML, Perl, and Python, but once you understand what you shared, you could definitely call one for a different language (like C++: I am betting that most c pretty-printers are really c++ pretty-printers, too).

    Code suggestions – there is some auto-completion, but it won’t go as far as code suggestions (and it’s definitely not going to be a copilot AI or anything like that).

    Is there a way to integrate serial monitor output or debugging processes within Notepad++ or via external tools? Is there a recommended workflow that allows me to combine Notepad++ with the Arduino IDE or PlatformIO for compiling and uploading, while primarily coding in Notepad++?

    I’ve never tried anything like that, so maybe someone else will be able to give more advice on that end.

  • 0 Votes
    6 Posts
    2k Views
    zylstraZ

    @Alan-Kilborn

    Hi, Alan, I tried this (i.e. your last suggestion) and I think it worked the first couple times I tried it, but now it has stopped working.

    I have tried restarting both the software and the OS (WIndows 10). I changed both the english.xml and my newly created english_customizable.xml. The localization file changes back to English on each restart, but like I mentioned I changed that file as well, so that it has <tab-untitled-string value=“”/>.

  • Notepad++ lags when text files are on FTP

    General Discussion
    11
    0 Votes
    11 Posts
    757 Views
    mkupperM

    @Alexander-Anisimov said in Notepad++ lags when text files are on FTP:

    You may be right. In my understanding, WebDAV is another way of connecting protocol but still is FTP, although different.
    May be I am wrong.

    You are wrong. :-)

    WebDAV is a protocol that is similar to HTTP that web browsers use with web servers. As WebDAV looks like HTTP on the network it works with NAT, firewalls, web proxies, etc. Accessing a WebDAV server is just like accessing a web server. Many web browsers have built-in support for WebDAV.

    That said, if there are bandwidth or latency issues accessing a particular WebDAV server then all applications, including Notepad++ will be impacted.

    WebDAV itself is not slow or laggy.

    If I was stuck with needing to edit files that are on a slow or laggy server then I probably would create script that first copies the file to the local hard drive, runs Notepad++ on the file, and then keeps an eye on both the local and remote copies of the file. If the local copy changes then I push it out to the remote server. If it changes on the remote side then pop-up a warning. A tricky aspect is that Notepad++ allows people to exit Notepad++ and then resume editing. Thus I can’t depend on Notepad++.exe going away as a signal that I no longer need to monitor and synchronize that file but also need to watch Notepad++'s session.xml file.

  • 0 Votes
    17 Posts
    6k Views
    PeterJonesP

    @Marshall-Brooks said in Double Ctrl+F won't bring the find dialog to the front of the primary window.:

    Also - somewhere along the way (8.81 or prior), Alan’s suggestion was implemented:

    v8.3.3 in March 2022, so a few months after Alan’s 2021 post. See https://github.com/notepad-plus-plus/notepad-plus-plus/wiki/Changes#833

  • Copying file itself into clipboard in Notepad++

    General Discussion
    23
    0 Votes
    23 Posts
    3k Views
    PeterJonesP

    @Alexander-Anisimov said in Copying file itself into clipboard in Notepad++:

    how can I bind a hotkey something like Ctrl+Shift+C to it?

    That’s explained in the FAQ. Search that page for “shortcut” (step 4 of the instructions) if you didn’t notice it.

  • Pascal multi line string highlight

    General Discussion
    2
    0 Votes
    2 Posts
    244 Views
    PeterJonesP

    @Ertan-Küçükoglu said in Pascal multi line string highlight:

    It would be nice to have it visualized as string in Notepad++

    Notepad++ uses a library called “Lexilla” to handle deciding what characters in a document to syntax highlight. When I use their testbed “SciTE” editor, it is showing that it’s treating the line ending with ''' as an “unterminated string”. But it apparently doesn’t know that Delphi recently added multi-line strings with the triple-quote syntax.

    The Lexilla project has ome reported issues about Pascal and Delphi – you can look through those, and see if any mention the multi-line strings. If not, you might want to request that they add it. Once they add it, and Notepad++ updates its Lexilla library, then Notepad++ could add that new styleID to the Style Configurator options for Pascal. But until they add the support, there’s nothing Notepad++ can do about the official lexing of the language.

    However, as a workaround, there is a plugin called “EnhanceAnyLexer”, which allows you to add regex-based foreground colors. Doing multi-line stuff with a regex is risky if there’s a mismatched triple-quote somewhere, but once you install EnhanceAnyLexer, open your Delphi/Pascal file, use Plugins > EnhanceAnyLexer > Enhance current language, which will open up a [pascal] section in the EnhanceAnyLexerConfig.ini. Set it to the following

    [pascal] ; Everything between pairs of triple-ticks is colored cyan 0xCCCC00 = (?s)'''.*?''' ;excluded_styles = 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,20,21,22,23

    (make sure you use the ; or # to coment out the excluded_styles, otherwise it won’t color properly; you can, of course, pick any 0xBBGGRR values you want to choose your own color, as described in the comments of the INI file.)

    With that INI saved, it will mean that from now on, the EnhanceAnyLexer plugin will color triple-quote multi-line strings in Delphi/Pascal files. like this example:
    5ba5abdd-c30f-4536-b470-290f55647f1a-image.png

    Since some people aren’t clear when I’ve given such instructions: once you save the EnhanceAnyLexerSettings.ini, the EnhanceAnyLexer will always apply that regex-based coloring to Pascal/Delphi files (you don’t have to run Enhance current language every time you want to turn it on; with the plugin installed, and the ini saved, it will be automatic).

  • 1 Votes
    35 Posts
    12k Views
    M

    @Denis-Rionnet said in Notepad++ has a Reload false alarm / bug? "This file has been modified by another program. Do you want to reload it"? even when it hadn't been recently modified at all?!:

    I understand that this behaviour can be disabled via the settings panel (it works: the warning gets muted)).

    How and where? nvm - found it with Google - Settings>Misc>File Status auto-detection.

    I’m having the same issue - for me, typically when I don’t save the file in NPP, lock the computer, and then unlock it and go back to editing.

    Files are stored on a network hard drive (not Cloud storage). File protocol is SMB, if that is what @ekpalypse is asking.

    I don’t think I’ve seen the message in NPP previously, but I’ve just started using it heavily.

    I agree, the feature was handy when it worked.

    For me, nobody else edit’s these files, and the one other program that I might edit them in notifies me if they were changed in NPP, so I’m okay with disabling it, but I’d like to see it fixed.

    Debug info:
    Notepad++ v8.8.1 (64-bit)
    Build time : May 3 2025 - 18:41:09
    Scintilla/Lexilla included : 5.5.6/5.4.4
    Boost Regex included : 1_85
    Path : C:\Program Files\Notepad++\notepad++.exe
    Command Line : “Z:_Brooks Work\FM ExtendScript\Scripts_2025\OPS_JG_Update_Variables.jsx”
    Admin mode : OFF
    Local Conf mode : OFF
    Cloud Config : OFF
    Periodic Backup : ON
    Placeholders : OFF
    Scintilla Rendering Mode : SC_TECHNOLOGY_DEFAULT (0)
    Multi-instance Mode : monoInst
    File Status Auto-Detection : cdEnabledNew (for current file/tab only)
    Dark Mode : OFF
    OS Name : Windows 11 Enterprise (64-bit)
    OS Version : 23H2
    OS Build : 22631.5472
    Current ANSI codepage : 1252
    Plugins :
    JSMinNPP (1.1905.1)
    mimeTools (3.1)
    NppConverter (4.6)
    NppExport (0.4)
    NPPJSONViewer (1.34)
    XMLTools (3.1.1.13)

  • 0 Votes
    9 Posts
    693 Views
    guy038G

    Hello, @ottiditto, @pbarney, @peterjones and All,

    A tiny piece of information : The & character is not a regex character, so the following syntax is sufficient :

    FIND (?-s)^((.*? layer=")(25)(".*?>&gt;NAME.*\R))

    REPLACE ${1}${2}21${4}

    Best Regards,

    guy038

  • ANSI escape sequences color rendering

    General Discussion
    13
    0 Votes
    13 Posts
    14k Views
    J_SwaJimeJ

    @PeterJones

    Sorry I wasn’t trying to stir up trouble. Either you are correct or I may simply have mangled things by going in the wrong order.

    Here is a pic showing miswritten regex I found via AI, which was what I was trying to correct. I did not find the ErrorList language feature until after writing my initial post.

    Screenshot_20250618_203154_RVNC Viewer.jpg

  • 0 Votes
    4 Posts
    404 Views
    FraF

    @PeterJones Thanks for the input.

    Surprisingly, just dragging and dropping all the files at once onto Notepad++ opens all the files in about 5 seconds for 1000 files.

    Then the XML Tools takes about 10 seconds to prettify all opened files.

    Then just go to File > Close All so to not have to close each file manually.

    Will do it that way.

    Would be great to update the XML tools plugin if someone’s able and it is not to much work.

    Or just adding the Pretty Print feature directly to the Find In Files feature as extra function for the next Notepad++ update.

  • 0 Votes
    3 Posts
    150 Views
    Ken McQuestonK

    @PeterJones

    That worked! Thanks for your help!

    Ken

  • 0 Votes
    2 Posts
    131 Views
    PeterJonesP

    @Paul-Cobben said in Cannot get Autocompletion to work for my own language:

    What am I doing wrong?

    Per the User Manual section on the autoCompletion definition file syntax (https://npp-user-manual.org/docs/auto-completion/#create-auto-completion-definition-files), with emphasis added:

    The basic character set used to recognize keywords is made of letters a-z, A-Z, digits 0-9, and the underscore _. Punctuation might work for auto-completion; however, if you want to use the parameter hints, you should not use punctuation in the keyword name.

    You are relying on the : at the start of the keyword and the - in the middle. This is a double-whammy against you. However, if you go to Settings > Preferences > Delimiter and set ⦿ Add your character as part of word to :- so that those two characters are more “word-like”, then restart Notepad++, it will be able to show up in the function-name autoCompletion:

    6c680cbc-5b88-4169-b76d-affbf204618e-image.png

    However, the parameter hint portion has two more problems:

    The easy one is you need func="yes" in the <KeyWord name="..." func="yes"> tags, otherwise Notepad++ doesn’t pay attention to the overload/param elements nested in the KeyWord. This might not ever work, because the internal regex that Notepad++ uses to determine if it’s valid to prompt for function parameters refuses to work because of the - in the keyword. If I have the delimiter setting as above, and added a keyword :FUNCT_SETTEXT which has the : as the prefix but does not include the hyphen, like:<KeyWord name=":FUNCT_SETTEXT" func="yes"> <Overload retVal="void" descr="Set a value in the STATUS.DAT file."> <Param name="Section" /> <Param name="Key" /> <Param name="Value" /> </Overload> <KeyWord> then when I type :FUNCT_SETTEXT(, it will prompt with the parameter hints as well: bf355c03-a51b-45ad-b0a3-47534ee92e2d-image.png As a workaround, you could “cheat” the - limitation by defining a second keyword which includes just the stuff that comes after the - in the keyword, like,<KeyWord name="SETTEXT" func="yes"> <Overload retVal="void" descr="Set a value in the STATUS.DAT file."> <Param name="Section" /> <Param name="Key" /> <Param name="Value" /> </Overload> </KeyWord> This will allow Notepad++ to see the - as a boundary and then the SETTEXT as a separate function, which then allows for the function parameter completion, as in this screenshot: d52f6232-de08-4b85-89cc-e2b852801a90-image.png
    (notice that it thinks the function is SETTEXT, not :FUNCT-SETTEXT, when doing the parameter prompting) Since punctuation isn’t guaranteed in function/parameter autoCompletion, that’s likely not going to be “fixed”, as it’s already relying on an unspecified edge case.

    In conclusion, if you just want the function autocompletion for the names with leading : and embedded -, you can do that by setting the Delimiter setting to :- , and it will work as in my first screenshot. If you want parameter hints when there are not hyphens in your function name, you can get that by setting the func="yes" in your <KeyWord...> tags, and that will work as in my second screenshot. Unfortunately, you cannot get the parameter hints directly if your keyword has the - because of a limitation in the internal processing that decides when parameter hints can be shown (though you can trick it as shown in item3).

  • Autocompletion and plugin

    Help wanted · · · – – – · · ·
    6
    0 Votes
    6 Posts
    456 Views
    General CoderG

    @Ekopalypse thanks for the info. I was hoping to avoid having to create custom autocomplete but cant have everything :)

  • 0 Votes
    7 Posts
    7k Views
    Robert BaerR

    Title says Win7 – works on Windows 11 too

    A bit late, but this post was the key to getting things working on Windows 11 for me. I had stuck with the 32-bit version for years and had installed it on a non-default disk. When I upgraded to the 64-bit version everything related to the right click menu stopped working.

    Using regedit to insure that this key pointed at my 64-bit install got things right.
    [HKEY_CLASSES_ROOT\Applications\notepad++.exe\shell\open\command]

    double click on default to see the actual key if you haven’t used regedit before.