• Help with Find please?

    2
    1 Votes
    2 Posts
    156 Views
    Alan KilbornA

    @Teresa-Mendoza

    A couple of ideas, if your word is apple:

    do a Find Next in Regular expression mode for ^.*apple.* with . matches newline unchecked – this will select the entire line of a match, so it is ready for Ctrl+c copy or Ctrl+x cut

    do a Find All in Current Document (in any search mode) for apple – this will opening the Search results panel which presents results on an entire line basis; right-click a hit line(s) and choose Copy Line(s) from the popup menu (sorry, no way to “cut” the original line with this method)

  • Renaming and saving text files based on its content

    3
    0 Votes
    3 Posts
    347 Views
    dr ramaanandD

    @Sam-Cem You can click and read How to replace a particular “url” with “url” of each webpage in multiple files using Notepad++? - I used the solution 2 mentioned at codeproject.com (the link to the codeproject.com webpage can be seen if you click the link I have mentioned above - do not click on the, “codeproject.com” link mentioned here).

  • Function list regex debugging

    25
    1 Votes
    25 Posts
    2k Views
    Alan KilbornA

    @Lycan-Thrope said in Function list regex debugging:

    but also still on occasion use the Regex101 site, since i have the link in the same menu area as the Notepad++ links, so it’s quick and easy

    I have my Run menu set up with a command to “Launch RegexBuddy”, thus making it as simple as what you’re saying that you have for regex101.

    RegexBuddy has a lot of options because it is very powerful. It’s always a struggle between simplicity and power, where a UI design is concerned – just consider Notepad++ itself.

    But we’ve probably strayed off-topic too much with talk of RegexBuddy.

    The important point I wanted to make was that people continually use regex101 and then, for more complex expressions, complain that Notepad++ isn’t acting the same way…and the reason for that is that they use different engines and neither one is wrong (but there is only something wrong when you compare different results obtained).

  • removing lines

    4
    0 Votes
    4 Posts
    235 Views
    Cal MurphyC

    @Coises said in removing lines:

    (?x-is) \A [\s\S]+ (?= ^ Extraction \x20 Log \R) | \x20 ( .+ (?= . \x20 Filename )

    Thankyou that looks like it as worked, much appreciated.

  • Regex with unexpected repeat application

    4
    0 Votes
    4 Posts
    331 Views
    Terry RT

    @Coises said in Regex with unexpected repeat application:

    Most likely the original poster has Settings | Preferences… | Searching | Replace: Don’t move to the following occurrence unchecked (I believe unchecked is the default), and is literally repeating both Find Next and Replace.

    I never knew that setting was there and was trying to figure out why he had a different result to me. Thanks, good to know there are still some things to learn about NPP.

    Terry

  • How to find string in range?

    8
    1 Votes
    8 Posts
    408 Views
    PeterJonesP

    @Hardik-Shah

    10.116.10.0 - 10.116.10.31
    10.116.10(0[0-2]|1\d|3[0-1])
    what I am doing wrong

    First, . means “match any character”, so that’s not what you mean. You should use \. to match a literal dot character.

    Second, you didn’t have a dot at all between the 10 and your group, so you are effectively looking for 10.116.10 followed by two more digits (with restrictions), but not looking for a dot in between. Your group say that it wants to match:

    either 0 followed by 0 or 1 or 2 or 1 followed by any digit or 3 followed

    Thus, you are trying to match

    10.116.1000 - 10.116.1002 or 10.116.1010 - 10.116.1019 or 10.116.1030 - 10.116.1032

    ----

    10.116.15.32 - 10.116.15.63
    search 10.116.15(3[0-2]|1\d|6[0-3])

    Again, you are missing the backslash before all the dots, and you are missing the dot between 15 and the final. And that one will thus match

    10.116.1530 - 10.116.1532 10.116.1510 - 10.116.1519 10.116.1560 - 10.116.1569

    And you haven’t told the regex anything about the .40-.49 or .50.59 range, so you cannot very well expect those to match (even if you fix the other problems)

    Hopefully, this explanation for why your attempts didn’t work, combined with @Coises earlier explanation, will help you understand where you are going wrong.

    If you cannot figure it out, the next time you show an example, and what you tried, also try to explain why you think it will work (explaining what every character or group of characters in the regex is doing), and we can then tell you why your explanation is wrong.

    But, as you have found, regex is not an easy way to find values within a mathematical range, especially for something complicated like an IP address. Every time you want to change the range, you will have to completely reconfigure your regex, and that’s going to get annoying for you. If you were using a programming language that had a library that can parse/understand IP addresses (any language worth its salt will have such a library), you could much more easily find IPs withing ranges, rather than relying on making a new custom regex for every range you want.

  • Directory under "Find in Files"-Search do not remember last folder

    3
    0 Votes
    3 Posts
    239 Views
    Alan KilbornA

    There really is no good reason for the Directory box to be auto-populated with the notepad++.exe folder in the case where Find in Files is invoked when a soft-named tab is currently active, thus I’ve created an ISSUE for it (I don’t consider it a bug, just an undesirable).

  • Through the title bar ?

    10
    0 Votes
    10 Posts
    2k Views
    E

    @xomx Thanks! That worked!

  • How to remove duplicate words in a list that are not consecutive?

    8
    0 Votes
    8 Posts
    867 Views
    Alan KilbornA

    @Debojit-Acharjee said:

    I can use script but I want to know why the “Remove Duplicate Lines” feature of “Line Operations” in Notepad++ doesn’t work when there are more than 30 thousand lines? Is there any thing to do with the CPU register memory?

    The best way to explore this is to create an “issue” on the official bug reporting site (see HERE for info on that) and attach the 30K+ file where it fails.

  • Yet another plugin admin does not install any plugins topic (OneDrive?)

    2
    0 Votes
    2 Posts
    170 Views
    rdipardoR

    Your OneDrive is a usually protected folder so the Windows OS will block any executable files from running in there.

    Check if your portable installation’s *.exe or *.dll files have the so-called Mark of the Web on them.

    You can use either Powershell:

    Get-ChildItem -Recurse -Include "*.exe","*.dll" | % { Get-Item $_.FullName -Stream "Zone.Identifier" -ErrorAction SilentlyContinue }

    or the Command Prompt:

    dir /S /R | findstr /R ".*exe:Zone\.Identifier:\$DATA .*dll:Zone\.Identifier:\$DATA"

    For each of the files that turn up, right-click with the mouse, select Properties, click Unblock, then Apply:

    motw

  • 0 Votes
    6 Posts
    481 Views
    GabrielPG

    @mkupper this worked great, thanks!
    9cdd4325-e8f6-40fa-9a85-d684b18cb503-image.png

  • Get my UDL to be listed in the style configurator

    3
    0 Votes
    3 Posts
    188 Views
    J

    @PeterJones
    Thanks for the quick response and explanation!

  • Solution for " Windows notepad corrupted by notepad++"

    2
    0 Votes
    2 Posts
    585 Views
    PeterJonesP

    @JimFingDandy ,

    You are incorrect. I have run the Notepad++ v8.6.3 installer, and do not have those registy settings that you mentioned. Nor do I have a c:\Windows\NotepadStarter.exe executable in my filesystem.

    But since your screenshot shows c:\Windows\NotepadStarter.exe, I am wondering whether at some point, you installed the “plugin” called NotepadStarterPlugin
    9dc94558-16de-4fec-bbb6-e664550d8562-image.png
    If you look at that plugin’s repo, changing those keys in the registry is exactly what it claims to do.

    update: Also, if you had read the full discussion that you linked to for your reply, you would have seen that the NotepadStarterPlugin was already identified as the likely culprit 7 years ago.

  • Syntax highlight % and %% lines differently

    5
    0 Votes
    5 Posts
    299 Views
    PeterJonesP

    @jnbearon said in Syntax highlight % and %% lines differently:

    @Ekopalypse
    I have a problem in that I am already short of Delimiter defs as the language definition form only allows 8 to be set. That then prompts 2 further questions:

    Can I define more than 8 delimiters - by editing the XML file?

    No. The number of colors is compiled into the program, and cannot be changed by a config file.

    Can I assign more than 1 delimiter to a particular colour? (I would be quite happy to bundle a few of the less often used ones into a single colour, but have the more popular ones having their own specified coloured line.

    Yes. You can see an example of this in the “Markdown (preinstalled)” UDL that ships with Notepad++:

    080344fd-fb48-40e5-9ed4-c2a91c9deb6e-image.png

    Just put the space-separated list of open and the space-separated list of close in the same order

  • 0 Votes
    2 Posts
    318 Views
    xomxX

    Known issue, Notepad++ is not a per-monitor DPI aware (V2) app yet. It is a GDI-app, so it needs additional coding to fix such issues.

    Here user reported a successful workaround:
    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14337#issuecomment-1835791674

  • Replace between two line

    7
    1 Votes
    7 Posts
    388 Views
    guy038G

    Hi, @zoltán-toldi, @coises, @alan-kilborn, @mark-olson and All,

    My previous regex may even be shortened as :

    SEARCH (?-i)^(\t+)(.+?)(\{(?:[^{}]++|(?3))*\})

    REPLACE $1$2{\r\n$1}

    To better understand this second search regex, we can use the free-spacing modifier (?x). Then, the search regex becomes :

    (?x-i) ^ ( \t+ ) ( .+? ) ( \{ (?: [^{}]++ | (?3) )* \} ) 1-----1 2-----2 3-----------------------------3

    So, after finding some leading tabs \t+ and the shorter text .+?, till an opening brace \{, the regex tries to match, either :

    An atomic group of characters, different from an opening and closing braces, followed with a closing brace

    An other group of characters ( the group 3 ), starting with an opening brace \{, which, in turn, can be followed with :

    An atomic group of characters, different from an opening and closing braces, followed with a closing brace

    An other group of characters ( the group 3 ), starting with an opening brace \{, which, in turn can be followed with, either :

    and so on …

    Note that the third group 3 is called, from within the group itself, with the recursive back-reference (?3).

    When a group x is called from inside its own group x, thanks to the (?x) syntax, this always defines a recursive regex !

    Note also that the use of the recursive (?0) syntax would refer to the whole regex $0

    You can control the depth of the recursion by using the {0,x} syntax, instead of the *, after the ending parenthese !

    Just try, against my INPUT example, the following values :

    {0,1} {0,2} {0,3} {0,4}

    You can verify that, with my example, the {0,4} is enough to cover all the cases. Of course, the * quantifier covers an infinite depth of recursion !

    BR,

    guy038

  • Change this gray color bit

    2
    0 Votes
    2 Posts
    175 Views
    Alan KilbornA

    @Jake-Dorr said in Change this gray color bit:

    Where can I change the coloring of that so it matches the orange/gray colors?

    Adjusting settings here (especially Top) will be the best you can do:

    4c2d746d-be24-4870-a6f4-c53d9e840d80-image.png

  • How to remove all data?

    8
    0 Votes
    8 Posts
    2k Views
    Alan KilbornA

    @jasoncom said in How to remove all data?:

    If the real portable version of Notepad++ is unzipped on an external USB flash drive (USB thumb drive) or an external hard drive, does it mean that the real portable version of Notepad++ will not leave any data in the computer (e.g. C:)?

    I believe that is a true statement.

  • Macro - copy and paste part of line

    9
    0 Votes
    9 Posts
    537 Views
    Martin SteinerM

    @Terry-R
    I’m sorry, I probably didn’t express myself very accurately the first time, it could also be the language barrier. However, your help brought me to my goal and now I have two macros that fulfill exactly what I needed and it’s to your credit. Thank you again for your time. :-)

    <Macro name="CopyMIX" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="0" message="2345" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?&lt;=\t)([^\t\r\n]+)$" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1702" wParam="0" lParam="512" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1" sParam="" /> <Action type="0" message="2178" wParam="0" lParam="0" sParam="" /> <Action type="2" message="0" wParam="42002" lParam="0" sParam="" /> </Macro> <Macro name="CopyUnity" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="0" message="2345" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?&lt;=\t)([^\t\r\n]+)(?=\t)" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1702" wParam="0" lParam="512" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1" sParam="" /> <Action type="0" message="2178" wParam="0" lParam="0" sParam="" /> <Action type="2" message="0" wParam="42002" lParam="0" sParam="" /> </Macro>
  • folder as workspace

    2
    0 Votes
    2 Posts
    146 Views
    Terry RT

    @zeta-orionis
    It’s referenced in the online manual here.

    Terry