• 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
    4k 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
    533 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
    277 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
    200 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
    796 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
    330 Views
    JustinJudoJ

    I did some googling and found a RegEx solution:

    Find:

    \?.*$

    Replace with:
    (null)

  • Sorting text

    6
    1 Votes
    6 Posts
    502 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
  • CTRL+DOWN/UP ARROW to move down/up to previous/next paragraph

    4
    0 Votes
    4 Posts
    286 Views
    Todd CarsonT

    @Todd-Carson said in CTRL+DOWN/UP ARROW to move down/up to previous/next paragraph:

    @Paul-Wormer Thank you very much, Paul. Yep, that works.

    However, for me, that’s totally non-standard for Windows. Is there a way to customise the keyboard shortcut to CTRL+DOWN/UP ARROW?

    (Please say yes!)

    Never mind. I found it. Thanks again.

  • Remove part of lines of text

    5
    0 Votes
    5 Posts
    1k Views
    mkupperM

    I interpret “I have a large number of text files which all start with a line as seen below” in that the afcad_path thing is always on line 1, or possibly is the first non-blank line.

    I would search for (?-s)\A\R*afcad_path =\K.+ and replace with nothing (blank) in regular expression mode.

    See https://npp-user-manual.org/docs/searching/#regular-expressions but in summary, (?-s) disables . matching newline (this is the default for most people and so (?-s) is redundant but is there just in case someone has . matches newline enabled), \A is the start of the file, \R* gobbles up the blank lines, if any, afcad_path = is the header string the OP is interested in, \K says to keep everything that has been matched so far (the blank line(s) and “afcad_path =” thing), and .+ wipes out the remainder of the line.

    If the file already starts with “afcad_path =” with nothing following, or does not start with a “afcad_path =” line then the search/replace will do nothing and the file is not modified.

  • Automated install not really installing

    2
    0 Votes
    2 Posts
    297 Views
    PeterJonesP

    @Jonathan-De-Carvalho ,

    I have no experience with remote installation, but I wouldn’t expect it to magically change Notepad++ over to the updated version while it’s actively running… and I’d actually be surprised if it could write the new notepad++.exe if the user were actively running the old notepad++.exe at the time.

    Could you do something like TASKKILL /IM notepad++.exe to forcefully kill the user’s Notepad++ instance? (if so, you might want to also send some message to the user before doing so, warning them that it’s about to happen, giving them a 30 sec pause so they can save their work before your taskkill, or similar.)

  • How to batch remove all lines after the nth line?

    4
    0 Votes
    4 Posts
    422 Views
    Alan KilbornA

    @melanievt

    Learn more to be able to apply such techniques on your own in the future; start HERE.

  • Increase counter

    5
    0 Votes
    5 Posts
    261 Views
    Daniel HolzmannD

    Thanks guys. I will go with litos81’s proposal which is working perfectly fine for what I need.
    The plug-in version I’d have considered for private purposes, but installing plug-ins on my work PC is always a big challenge for our IT department.

  • Removing multiple blank lines

    5
    0 Votes
    5 Posts
    473 Views
    Alan KilbornA

    @namx3249 said in Removing multiple blank lines:

    and why don’t use command from Edit - Line operations - Remove empty lines ?

    Because OP wanted a “single blank line” to remain after the operation.

  • UDL comment that requires seperators

    10
    0 Votes
    10 Posts
    565 Views
    Mark OlsonM

    I finally came up with a regex-replace that adds buffer spaces internally as well as externally, if you are interested.

    Replace (?s)(\S)?/\*((?!\*/)\S)?((?:(?!\S?\*/).)+?)?((?!\*/)\S)?\*/(\S)?
    with (?1\1\x20)/*(?2\x20\2)(?3\3:\x20)(?4\4\x20)*/(?5\x20\5)

    Just for the record, a lot of the complexity of that regex-replace is due to dealing with the silly corner case of replacing /**/ with /* */. You could absolutely come up with something simpler if you didn’t care about that.

  • Are hanging indents not possible?

    2
    0 Votes
    2 Posts
    195 Views
    CoisesC

    Settings | Preferences… | Editing | Line Wrap : Indent

  • Ending changing to Chinese GB2312

    5
    0 Votes
    5 Posts
    1k Views
    PeterJonesP

    @madara-san ,

    Please stop using generative AI to write your posts for you. It’s not helping anyone.

  • Please help me turn this off

    2
    0 Votes
    2 Posts
    205 Views
    PeterJonesP

    @Thành-Nguyễn said in Please help me turn this off:

    Please help me turn this orange column off. Thank you everyone!

    Read this FAQ to learn more about that feature: the feature is there to help you, not hurt you, but the FAQ explains how to disable it if you really cannot handle improved UI

  • How can I find the value to send to Notepad++ through send message.

    7
    0 Votes
    7 Posts
    554 Views
    asadMarmashA

    This is great! Thank you all for your comments and suggestions, and a special thanks goes to @Alan-Kilborn for providing the table.