• Disabling windows shell integration

    8
    0 Votes
    8 Posts
    892 Views
    John ParnellJ

    @PeterJones

    It’s making sense that the problem wasn’t fron the standalone package. I searched the Registry and there was some references to NPP in program files that no longer exists. It seems that probably what happened was when Windows failed to find that file reference so redirected to the existing standalone package with that executable once excecuted. I cleaned all Registry reference so Windows wouldn’t have a missing file reference to redirect and it hasn’t returned.

    It’s been awhile since I did a good Registry clean.

  • 0 Votes
    5 Posts
    413 Views
    Lycan ThropeL

    @Bonnie-Stevens ,
    The people here are not mind readers, regardless of your native language. If you refuse to read the documents that you have been given links to, to describe the problem you are having, then like the old computer programming adage, “Garbage in, Garbage out”, is all you will get.

    If you won’t put the work in to describe the issue, you can not be helped. Read links that Terry gave you.

  • I need help deleting text before a certain point.

    3
    0 Votes
    3 Posts
    306 Views
    Lycan ThropeL

    @Sam-Gabes
    Even though you’ve been given the answer to this one, be sure to check this link to learn how to do it yourself.

    https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regular-expressions-regex-documentation

  • Only showing null characters and strange symbols

    5
    0 Votes
    5 Posts
    439 Views
    TheMostExtremeRatParkourT

    @PeterJones ooohhh okay thanks

  • Add double quotes @ start and en of line + text in midle +more

    5
    0 Votes
    5 Posts
    3k Views
    Lufi SaL

    @Gilles-Girard said in Add double quotes @ start and en of line + text in midle +more:

    After many hours searching I now have a basic understanding (limited to autohotkey experience).
    Seeking help to put the pieces together.
    1- need to add double quotes to the start and end of each lines
    2- I need to make this a single line with additional text after the first line (or [Source.Name] =)
    The following list :
    Request 1.xls
    request 2.xls
    request 3.xls
    would become
    “Request 1.xls” or [Source.Name] = “request 2.xls” or [Source.Name] = “request 3.xls”

    Screenshot 2023-05-06 203733.png
    This script first initializes a variable fileList with the names of the files. It then loops through the list and adds double quotes to the start and end of each file name using the Chr() function to insert the ASCII code for a double quote (34).

    The script also creates a variable output to store the final output string. The first file name is added to the output variable without the “or [Source.Name] =” prefix, while the rest of the file names are appended to output with the prefix.

    Finally, the MsgBox command displays the final output string as a message box.

    You can customize the fileList variable to include your own list of files. Just replace the names in the square brackets with your own file names.

  • generic-regex-replacing-in-a-specific-zone-of-text

    9
    3 Votes
    9 Posts
    619 Views
    Mark OlsonM

    @Paul-Wormer
    Time to unpack the (?s-i:(?!ESR).)*? part of the regex, which is what your new version is currently missing.

    Essentially this is divided into four parts:

    the flags: ?s-i

    These say that:

    the . metacharacter should match everything (that’s the s flag) we want to be case-sensitive. That’s the -i part. consume a character unless the end of the search region is right ahead: (?!ESR).

    This looks ahead without consuming any characters to see if the ESR is in front of you, and then stops if it is. An example:
    Search string: cacb ab
    regex: (?!ab).
    At the start of the string, we look ahead for ab. The next character is c, so we consume c. (remember, this is SUCCESS because we want to NOT match the ESR).

    string: cacb ab want: _ab match: ! consumed: YES

    Now we’re after the first c, before the first a. We look ahead for ab, but see ac instead, so we’re clear to advance.

    string: cacb ab want: __ab match: *! consumed: YES

    You can see that there are no ab anywhere except at the end of the string, so everything will match.

    Let’s fast-forward to the end of the string:

    string: cacb ab want: ______ab match: ** consumed: NO

    We’re now positioned between the blankspace and the ending ab. The next two characters are ab, so this whitespace character will NOT be matched.

    Do the above thing any number of times: (?s-i:(?!ESR).)*?

    This just says to keep looking ahead and stopping if the ESR is ahead, then consuming a character, then looking ahead… until the ESR is reached or the entire string is consumed.

    Interesting note: Rexegg.com refers to this as “tempered greed” because you’re greedily trying to eat the whole string, but checking to see if you’re full before you take each bite.

    Putting it all together:

    So as @guy038 illustrated above, the (?-i:<text>|(?!\A)\G)(?s-i:(?!</text>).)*?\K-+ regular expression is going to start with (?-i:<text>|(?!\A)\G) by matching either <text> (the BSR) or the end of the last matched region (unless you wrapped around).
    Now the (?s-i:(?!</text>).)*? part comes into play. It behaves as I described above: the negative lookahead for </text> ensures that you cannot go past the ESR.

    The rest is the same, as you correctly identified:

    forget everything you matched so far (the \K) match any number of - characters (-+).

    For the record, I think that part of the problem with the readability of this regex has to do with the flags. The version of the regex without flags, (?:<text>|(?!\A)\G)(?:(?!</text>).)*?\K-+, is I think a bit less confusing.

  • .bak file

    4
    1 Votes
    4 Posts
    36k Views
    nghĩa lê nguyễn duyN

    @Dương-Minh-Hoàng Open Notepad++ and go to Settings=>Preferences=>Backup than select “None” from Backup on save. That’s it

  • Deleted a temporary new file, can I restore it?

    4
    0 Votes
    4 Posts
    236 Views
    I.zi.biaI

    @PeterJones said in Deleted a temporary new file, can I restore it?:

    If you had that option on, it would have kept a copy of your unsaved file in that directory

    It should be mentioned that this is true only for the “Main” instance (TheFirstOne in the npp source code) of npp.

  • Enable session snapshot and periodic backup?

    8
    0 Votes
    8 Posts
    2k Views
    I.zi.biaI

    @Michael-Vincent said in Enable session snapshot and periodic backup?:

    Again, without looking at the code, I believe “Remember current session for next launch” saves the current session on Notepad++ exit, whereas “Enable session snapshot and periodic backup” saves the current session on the time interface specified and at Notepad++ exit. In that respect, it’s more like a background auto-save in case of a “crash”?

    I have run some tests with npp v8.4.8, and my observations are different:

    “Enable session snapshot and periodic backup” only enables periodic snapshot. It has nothing common neither with sessions nor with config: I tried to kill notepad++.exe and I noticed no changes of config.xml and session.xml.

    Remember current session for next launch has two effects

    it allows that session.xml is (re)written on npp close it allows that session.xml is loaded on next startup of npp
    (of course, 1. and 2. happens only if all conditions are met.)

    (Unchecking Remember current session for next launch doesn’t delete existing session.xml, and so it may6 be activated later by config.xml edit)

  • Compatibility of Notepad++ 7.5.1 with Windows 11 pro

    2
    0 Votes
    2 Posts
    366 Views
    mkupperM

    @Özgür-Aydogdu said in Compatibility of Notepad++ 7.5.1 with Windows 11 pro:

    Is Notepad++ version 7.5.1 compatibel with Windows 11 pro?

    I use Win 11 normal (I assume home) and v7.5.1 portable 32-bit edition seems to run fine. I would assume it would also work on Win 11 Pro.

    It is safe and easy to download and try any of the portable versions. A portable copy of Notepad++ is just a set of files that don’t make any changes to the Windows registry or other parts of Windows.

    Note that if you want to run two or more versions of Notepad++ at the same time, side by side, then use the -multiInst command line option. If you don’t then the second instance of Notepad will see that the first is running and will jump to using that instead of the copy you wanted to start. For example, I had downloaded v7.5.1 to c:\bin\npp751 and so run it using c:\bin\npp751\notepad++ -multiInst Now I have my normal copy of Notepad++ running and a second Notepad++ that’s the v7.5.1 for testing.

  • problem with this regex: \b.{1,6}\b

    5
    0 Votes
    5 Posts
    290 Views
    Bahaa0013B

    @Mark-Olson
    Thank you very much, it worked very well…
    Also thanks to everyone who tried to help.

  • Find and Replace with variable within RegEx

    10
    0 Votes
    10 Posts
    1k Views
    guy038G

    Hi, @peterjones,

    Sorry, Peter, but as I well used to posting on our forum, I has not had a look, yet, to the FAQ about formatting :-((

    And, indeed, all is very well explained in this FAQ ;-)) So, my previous post is redundant and useless !

    BR

    guy038

  • How can I open timestamps?

    14
    0 Votes
    14 Posts
    1k Views
    Lycan ThropeL

    @Mark-Olson ,
    He still doesn’t get it. He doesn’t get that this is not a wordprocessor which MIGHT record those kind of changes within the meta data of the document. Let’s move on.

  • Ignoring empty lines counting

    24
    0 Votes
    24 Posts
    5k Views
    CoisesC

    @Alan-Kilborn said in Ignoring empty lines counting:

    @guy038 said in Ignoring empty lines counting:

    The regex ^$, indeed, does not count true empty lines !

    but :

    The regex ^\R does count empty lines !!

    If the regex is purely an assertion, e.g. ^$ or \b (to name but two), then its match won’t be counted by Count.

    True (since a pure assertion is always an empty match), but empty matches aren’t counted regardless of how the regular expression is specified. In a file that has empty lines, but no lines containing only capital Ws, ^W*$ counts zero matches. ^\R counts all empty lines (except the last line, if it’s empty) because it isn’t an empty match: it matches line ending characters. ^.*$ and ^.+$ both count all lines that are not empty.

  • Copy then paste elsewhere

    6
    0 Votes
    6 Posts
    573 Views
    Cal MurphyC

    @Alan-Kilborn

    Thanks for that i will have a look at it, when i have a bit of time available.

  • Acoustic signal when search no (more) results

    6
    0 Votes
    6 Posts
    313 Views
    guy038G

    Hello, @tdi-ger, @alan-kilborn, @peterjones and All,

    Oh…, my bad ! I just didn’t read the original post carrefully :-((

    As I unchecked this setting for the very first time, I wanted to verify that it did not interfere with the OS. Hence, my remark about my music’s try !

    So, as you said, @tdi-ger should verify if that option is UN-checked , in its configuration -))

    BR

    guy038

  • Exclusive Session file group

    3
    0 Votes
    3 Posts
    211 Views
    guy038G

    Hello, @Jagganath69, @mark-olson and All,

    @Jagganath69, here is a way to get exclusive session group of files :

    In a DOS console window, run the command notepad++.exe -nosession

    Note that I personnaly chose the ses extension as the session file extension ( Settings > Preferences > MISC. )

    Open, let’s say, three files, named A, B and C

    Use the File > Save session... option

    Save the current session, for instance, as First.ses

    Close Notepad++.exe

    Restart the same command notepad++.exe -nosession

    Open, this time, three other files, named D, E and F

    Use the File > Save session... option

    Save the current session, for instance, as Second.ses

    Close Notepad++.exe

    From now on :

    If you run the command notepad++.exe -nosession -openSession First.ses, the three files A, B and C will ONLY be opened

    If you run the command notepad++.exe -nosession -openSession Second.ses, the three files D, F and F will ONLY be opened

    If you run the command Notepad++.exe, you should see all the files which were present in the current session, when you last closed notepad++

    Of course, when you simply start notepad++.exe, the current session may contain :

    Files which are absent of all the particular sessions First.ses, Second.ses, …

    Files which are present in particular sessions ONLY

    Files which are present in all the particular sessions First.ses, Second.ses, …

    Best Regards,

    guy038

  • Is it possible to change color of title bar when window is active?

    4
    1 Votes
    4 Posts
    862 Views
    Lycan ThropeL

    @Divzed ,
    In the dBASE newsgroups, we just had such a request of trying some code to do just this kind of thing, and as one of our more experienced programmers stated, it’s been difficult to do this kind of thing because the colors on the Windows Title bar, etc, are connected to the “themes” aspect and is diffiult to change without in depth knowledge, because as he pointed out, if you change that, you have to change everything related to it (window resizing, etc) because you’re intercepting and overriding the current theme with specific items in the UI, meaning, you now own the control of everything pertaining to it. He also pointed out that in the past, it may have been ‘relatively’ easier, but with Windows 11, the whole game has changed with regard that control.
    Not being his caliber of programmer, I’m only able to relay the gist of his more technical explanation, but it’s something I wouldn’t even be tempted to attempt as I can’t see that kind of work just to change a color. Microsoft keeps making customization harder than it needs to be to just plug and place a color change, so it doesn’t appeal to me. :)

  • Find & Replace question with RegEx solution

    2
    0 Votes
    2 Posts
    366 Views
    JustinJudoJ

    I did some googling and found a RegEx solution:

    Find:

    \?.*$

    Replace with:
    (null)

  • Sorting text

    6
    1 Votes
    6 Posts
    527 Views
    PeterJonesP

    @Qwfsdf-Qdfwefx said in Sorting text:

    i really dont know what i need to change in ur code

    Oddly enough, if you don’t have quotes and commas in your new text document, you would likely get rid of quotes and commas from @Mark-Olson’s example regex.

    ----

    Please note: This Community Forum is not a data transformation service; you should not expect to be able to always say “I have data like X and want it to look like Y” and have us do all the work for you. If you are new to the Forum, and new to regular expressions, we will often give help on the first one or two data-transformation questions, especially if they are well-asked and you show a willingness to learn; and we will point you to the documentation where you can learn how to do the data transformations for yourself in the future. But if you repeatedly ask us to do your work for you, you will find that the patience of usually-helpful Community members wears thin. The best way to learn regular expressions is by experimenting with them yourself, and getting a feel for how they work; having us spoon-feed you the answers without you putting in the effort doesn’t help you in the long term and is uninteresting and annoying for us.

    ----

    Useful References Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation