• Replace character in capture group

    28
    0 Votes
    28 Posts
    4k Views
    guy038G

    Hello, @peterjones,

    Sorry, I’ve just seen your post where you asked people to verify the N++ official documentation ! I’ll try to have a look, myself, very soon. It would be better to do it before the next release of the website !

    But, as I said to Alan, at the moment, my TO DO list, concerning N++ or else, is getting much longer ;-))

    Cheers,

    guy038

  • How to merge 2 separate lines into 1 line for a numerous amount of data?

    8
    0 Votes
    8 Posts
    324 Views
  • Bug with Language ?

    7
    0 Votes
    7 Posts
    387 Views
    AndreiA

    @PeterJones thank you. I put nativeLang.xml file to %AppData%\Notepad++\ with GPO. My problem solved.

  • Crash when type the text

    4
    0 Votes
    4 Posts
    222 Views
    PeterJonesP

    @Tseng-Alvin ,

    The reason @rinku-singh asked was because we have seen problems with the re-packaging that sites like portableapps use, causing things to not work.

    With Notepad++, there is no reason to risk someone else’s re-packaging, because a portable zip has been made available with every release on the official downloads page.

  • Regex Search Help!

    6
    0 Votes
    6 Posts
    233 Views
    Alan KilbornA

    @Nick-Brown 's regex is problematic for at least 2 more reasons:

    it does a greedy search rather than a minimal search, meaning that it will match something like "Number":"12345","23456","34567", fully, not stopping after only matching “one number”, which seems to be what the OP desires

    in conjunction with the first point, without specification of whether or not the . should match newlines, this regex could potentially match a lot of lines and a lot of data!

  • Hyperlinks not clickable anymore

    2
    0 Votes
    2 Posts
    266 Views
    L

    @BernieStn said in Hyperlinks not clickable anymore:

    Is this a known issue?

    I’m using Notepad++ 7.9 and it does recognise the last two lines as URLs I guess the protocol part of the URL is necessay for Notepad++ detect as a proper URL. Could you please check if you have enabled the option to make links clickable? (https://npp-user-manual.org/docs/preferences/#misc). Settings > Preferences... > MISC

    Also, it may help to post here Notepad++'s Debug info... that is under the ? Menu, and whether you are using any particular theme.

  • Hotkeys for Zoom don't work!

    5
    0 Votes
    5 Posts
    533 Views
    Дмитрий 1Д

    Peter Jones, thank you very much! I found the " / " key on the numeric keypad! Hotkeys a work now :)

  • Dual View

    3
    0 Votes
    3 Posts
    154 Views
    Tom OveringtonT

    Thank You Kindly. Figured it was something simple. Tried everything except that.

  • Download Dictionaries Dialog

    6
    1 Votes
    6 Posts
    2k Views
    pellelinP

    Hello Peter!

    That was spot on! You are a lifesaver!
    Had almost given up and was thinking of installing an older version of Notepad++.
    I managed to get the eng UK, eng US and swedish! YAY! :D

    Thanks Peter, stay safe and healty, best regards,
    pellelin

  • 0 Votes
    8 Posts
    291 Views
    PeterJonesP

    @Richard-Skinner ,

    Rather than arguing with those who are trying to help you, why not provide better example data, for both “before” and “after” the transformation you want, that matches your description of the data, so that we have a better understanding of what you’re trying to achieve? Since your descriptions don’t match the example text, it’s rather difficult for us to come up with a regex that will work with your data. If column number is the important thing, then focus on columns in your description and example data; if the important thing is actually anything after the seven digits of ?id=7777777, then focus on that string and not column number. But insisting on 52 characters when your example data isn’t 52 characters long is … tiring.

    Even though you haven’t shown that you understood or took my advice to heart, I’ll give you two guesses: one that assumes that the critical piece of information is 52 characters, and one that assumes that the id is the critical piece:

    52 char FIND = (?-s)^(.{52}).*$ Explanation: turn off .-matches-space, match beginning of line, match 52 characters and store in group 1, match remaining characters on line REPLACE = $1 replace with contents of group 1 (so effectively deletes everything after the first 52 characters) MODE = Regular Expression ID FIND = (?-s)(\?id=\d{7}).* Explanation turn off .-matches-space, match ?id= followed by 7 digits and store in group 1, match remaining characters on line REPLACE = $1 replace with contents of group 1 (so effectively deletes everything after the 7-digit ID) MODE = regular expression
  • 3 Votes
    1 Posts
    875 Views
    No one has replied
  • Hyperlink to a file? Win10

    11
    1 Votes
    11 Posts
    9k Views
    GarySe7enG

    @PeterJones said in Hyperlink to a file? Win10:

    you can select a path (whether relative or absolute, like c:\blah\file.txt or …\blah\file2.txt, and right click and select Open File

    Wow! This is great. Obviously, I’ve never noticed that before. But this certainly makes the ability to link notes significantly easier.

    I’ve given up on most note taking applications. Evernote, OneNote, even tried Joplin. But nothing has replaced a bunch of old fashioned text files, many of them now in markdown format, and replicated using NextCloud.

    NextCloud has a decent markdown editor for mobile. All workstations need nothing more than NPP (which is on all of my systems).

    Thanks again!

  • ShellExecute failed (2) is this command correct

    2
    0 Votes
    2 Posts
    230 Views
    Alan KilbornA

    @Phil-Kuffner

    It might be best to post a screenshot of the error rather than just summarizing its text; we can probably glean information to help you better that way.

  • Error Build from Source Code

    2
    0 Votes
    2 Posts
    207 Views
    andrecool-68A

    Where are the photos of these errors?

  • SaveAs as last command in macro; possible?

    5
    1 Votes
    5 Posts
    649 Views
    PeterJonesP

    @Alan-Kilborn ,

    The end of NppCommands.cpp has the list of IDM_ entries (ie, the menu commands) that are macro-recordable. So any not listed there are not.

  • Notepad++ just deleted all the text from my files

    40
    0 Votes
    40 Posts
    6k Views
    Alan KilbornA

    @carypt said in Notepad++ just deleted all the text from my files:

    to absolutely know , what is done and where and under what name in my filesystem

    When you have a file open in a tab in Notepad++, you can see where changes to it will be saved by:

    looking at the title bar of N++, where the full path is shown (there is a preference setting to turn this off but it is on by default)

    hovering over the tab with the mouse, at which point a tooltip window will pop up, showing the complete path

    REPEAT: There is no need ever to do a Save As on an existing file, unless you intend to create a copy with a different name.

    You seem to be a different kind of thinker.

    And for other readers: No, @carypt 's postings in this thread are NOT related to the NUL NUL NUL problem in Notepad++.

  • File Filtering based on content

    6
    0 Votes
    6 Posts
    806 Views
    TheRobsterT

    Thanks, I got what I was looking for!

  • Make default file the far right file.

    2
    0 Votes
    2 Posts
    176 Views
    Alan KilbornA

    @Cheryl-Bouc

    The one you are noticing it activate is likely the one you “visited” prior to the one you are closing. That behavior is called “MRU” or “Most Recently Used”. You can select/deselect that behavior with this setting:

    7a545e41-a612-4339-9cbe-803f7863e793-image.png

  • Is there a way to center text like this?

    6
    0 Votes
    6 Posts
    1k Views
    guy038G

    Hi, @hello313241, @michael-vincent, @terry-r and All,

    Very, very clever solution Terry ! Indeed, no need for \K and just to type in half the screen size of spaces, in the Replace zone ;-))

    And I also improved the process as we do not need, any more, to trim the trailing blank chars at the end. In addition to the mandatory regex part .{80}, I placed, before, a look-ahead (?=(.+[^\x20\r\n])\x20+) which splits these 80 characters in two zones :

    A first zone (.+[^\x20\r\n]) which must end with a non-blank and Non-EOL character, to rewrite in replacement ( \2 )

    A second zone \x20+ of blank characters only, to ignore

    So we need two regex S/R, only ( Note that I follow my previous post with 140 characters for screen size )

    The first S/R removes possible blank chars of a pure blank line OR replace any range, possibly null, of leading and trailing blank chars with 70 space characters ( 140 / 2 )

    SEARCH ^\h*$|(^\h*|\h*$)

    REPLACE ?1<followed with 70 spaces>

    The second S/R replaces any full line of the selection, magically, with the range of ( 140 - L ) / 2 space chars, followed by the text to be centered, of size S :

    SEARCH (?-s)^(\x20*)(?=(.+[^\x20\r\n])\x20+).{140}\1\x20?

    REPLACE \2

    Remarks :

    As the total of any line of the selection is 140 + S characters long, thus the length of the surrounded range \1 is S/2 characters

    I had to add the final \x20? regex because, in case the size S is an odd number, this extra space char is also matched and deleted after replacement !

    All lines of the selection must have a size inferior or equal to 140. Lines, with size over 140, are shifted by 140 / 2 space characters !

    So, the final macro is now simplified as :

    <Macro name="Center Selected Lines" Ctrl="no" Alt="no" Shift="no" Key="0"> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="^\h*$|(^\h*|\h*$)" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="?1 " /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> <Action type="3" message="1700" wParam="0" lParam="0" sParam="" /> <Action type="3" message="1601" wParam="0" lParam="0" sParam="(?-s)^(\x20*)(?=(.+[^\x20\r\n])\x20+).{140}\1\x20?" /> <Action type="3" message="1625" wParam="0" lParam="2" sParam="" /> <Action type="3" message="1602" wParam="0" lParam="0" sParam="\2" /> <Action type="3" message="1702" wParam="0" lParam="640" sParam="" /> <Action type="3" message="1701" wParam="0" lParam="1609" sParam="" /> </Macro>

    For instance, this initial text, where I used some sentences from the License.txt file and add some trailing blank chars :

    This example works ONLY IF the TOTAL size of your SCREEN contains 140 characters ADAPT to your CONFIGURATION, by adding HALF the APPROPRIATE number of SPACES, after "?1", in the REPLACEMENT zone of the 2ND regex S/R >< >< >< Copyright (C)2016 Don HO <don.h@free.fr> The licenses for most software are designed to take away your freedom to share and change it 1 Copyright (C) 1989, 1991 Free Software Foundation, Inc. ABCD Everyone is permitted to copy and distribute verbatim copies You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee 12345 12345 12345 12345 12345 az 1 To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. 1234567890 >< >< ><

    Would be modified and centered as below :

    This example works ONLY IF the TOTAL size of your SCREEN contains 140 characters ADAPT to your CONFIGURATION, by adding HALF the APPROPRIATE number of SPACES, after "?1", in the REPLACEMENT zone of the 2ND regex S/R >< >< >< Copyright (C)2016 Don HO <don.h@free.fr> The licenses for most software are designed to take away your freedom to share and change it 1 Copyright (C) 1989, 1991 Free Software Foundation, Inc. ABCD Everyone is permitted to copy and distribute verbatim copies You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee 12345 12345 12345 12345 12345 az 1 To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. 1234567890 >< >< ><

    Best Regards,

    guy038

  • RegEx.: Fetched Group not working at replacement string;?

    10
    0 Votes
    10 Posts
    313 Views
    Flores FranciscoF

    @guy038 said in RegEx.: Fetched Group not working at replacement string;?:

    Best Regards,
    guy038

    Guy I like how you see things.

    Thank you for your time good sir…

    I understand your explanation well.

    Regards…