• Regular expression match to the end not to selected

    3
    0 Votes
    3 Posts
    258 Views
    Danek SzczepanD

    @Alan-Kilborn said in Regular expression match to the end not to selected:

    @Danek-Szczepan said in Regular expression match to the end not to selected:

    notepad++ select from <p><!-- (first line in file) (to last line in file that contains) --></p> How to fix it?

    Change your usage of .* to .*?.

    Learn more starting HERE.

    Working, thank You !

  • Replace folder path using wildcard

    5
    0 Votes
    5 Posts
    466 Views
    jonnieg4rdnerJ

    @Alan-Kilborn Perfect!!!

    Thanks for your help.

  • button, menu, tooltip color

    2
    0 Votes
    2 Posts
    281 Views
    TBugReporterT

    For the sake of anyone who might come across this in the future looking to solve a similar problem: The answer isn’t in the Style Configurator, it’s in the Preferences.
    Screenshot 2023-06-22 001611.png
    This is how my program was configured both before and after I fixed the problem. To fix it, I briefly selected a different option in this dialog and immediately reselected the original. I don’t know why this was claiming to be using the settings shown when they were only partially in effect. I would file a bug report, but I don’t know what I did to break this, so I can’t reproduce it.

  • Repeat lines and add empty lines after every line

    5
    0 Votes
    5 Posts
    255 Views
    J

    @Terry-R said in Repeat lines and add empty lines after every line:

    intention to be using these regexes independently

    Yes, it was my intention to be using these regexes independently - so the ones provided @Mark-Olson are perfectly fine. It’s incredible how helpful and fast responding this community is - I haven’t seen that before. Thanks a lot to you all!

  • finding a partial number with Wildcard

    6
    0 Votes
    6 Posts
    371 Views
    Mark OlsonM

    Suppose you want to find text in AcctNbr tags containing the numbers 48, 17, and 34 in any order. You could enumerate every possible ordering of those numbers, but that would become increasingly intractable as the number of things to be matched got larger (e.g., there are 24 possible orderings of four distinct things). This is where forward lookahead really shines.

    (?-si)<AcctNbr>(?=(?:(?!</AcctNbr>).)*?17)(?=(?:(?!</AcctNbr>).)*?34)(?=(?:(?!</AcctNbr>).)*?48).*?</AcctNbr>

    Try that out on the below text to see what I mean.

    <AcctNbr>1 2 3 4</AcctNbr> <AcctNbr>1 2 23 14</AcctNbr> <AcctNbr>27</AcctNbr> <AcctNbr>1234</AcctNbr> <AcctNbr>34 18</AcctNbr> <AcctNbr>48734</AcctNbr> <FooNbr>34 17 48</FooNbr> <!-- last three should match --> <AcctNbr>34 17 48</AcctNbr> <AcctNbr>4817 34</AcctNbr> <AcctNbr>483417</AcctNbr>

    NOTE: this method allows overlap between things to be matched, e.g., 348 would count for both 34 and 48. There is no efficient way to do this without making the regex much nastier.

  • PythonScript wrap around find/replace

    4
    0 Votes
    4 Posts
    225 Views
    M Andre Z EckenrodeM

    @Alan-Kilborn , @PeterJones :

    Thanks for weighing in. What I’m trying to do is a somewhat complicated regex find/replace on a file roughly represented as such:

    [1st line containing data to be used in replacement elsewhere] […] [2nd line containing data to be used in replacement elsewhere] […] [3rd line containing data to be used in replacement elsewhere] […] [1st line where replacement will take place] […] [2nd line where replacement will take place] […] [3rd line where replacement will take place] […]

    Each instance of […] is one or more lines of other data.

    Starting at the beginning of the file, my FIND pattern will match from [1st line containing data to be used in replacement elsewhere] all the way through [1st line where replacement will take place], then insert data retrieved from the former into the latter, and also deleting all lines from start of file up to but not including [2nd line containing data to be used in replacement elsewhere] in the same process. I was hoping it would be simple to have it go on finding/replacing for all the remaining corresponding line pairs if I could make it use Wrap around and Replace All— though perhaps it wouldn’t, since some of the data within the target match areas will have changed between quasi-iterations — but guess I’ll concede defeat and make a loop. Thanks again!

  • notepad++ 7.8.8 is not working with windows server 2019 (citrix VDI)

    1
    0 Votes
    1 Posts
    275 Views
    No one has replied
  • moving year in a date from the end to the front.

    27
    0 Votes
    27 Posts
    2k Views
    Alan KilbornA

    @Paul-Wormer said in moving year in a date from the end to the front.:

    Why not use \s

    For the same reason that I hesitatingly recommended \h … because it opens up the match to more than what is wanted, a dangerous thing to do with regex.

  • REGEX: a single line should contain each word in a paragraph.

    8
    0 Votes
    8 Posts
    352 Views
    Alan KilbornA

    @Paul-Wormer said in REGEX: a single line should contain each word in a paragraph.:

    Maybe I’m missing the point

    The point you may be missing is that the OP probably has a lot of data to act upon, making doing it “by hand” impractical.

  • How can I update font in npp

    3
    0 Votes
    3 Posts
    335 Views
    Ryuu -R

    @PeterJones Sorry, I don’t know there’s such a thing so I guess npp use some local font.
    This solve my problem, thank you.

  • Extract number between two strings

    2
    0 Votes
    2 Posts
    269 Views
    Terry RT

    @Shahir-Afif said in Extract number between two strings:

    Is there even a possibility to achieve this? I would greatly appreciate your inputs…

    It certainly is possible, and you were on the right track.
    Find What:(?-s).+?object_id=(.+?)sap_archive.+
    Replace With:${1}

    Should work for you.

    If you want more information on what it is doing ask.

    Terry

  • 0 Votes
    4 Posts
    694 Views
    Rob PetersonR

    @PeterJones derived my answer from the discussion post… played around with the values in GUI section of the config and got it working. Thanks again for the assistance!

  • Remove last 5 characters from lines in text file?

    4
    0 Votes
    4 Posts
    3k Views
    M Andre Z EckenrodeM

    @drghty

    By the way, you wrote “remove the last 5 lines from a text file”, but your example indicates removal of the last 5 characters from each line, so I assume the latter was correct.

    @Mark-Olson

    Ah, yes — my bad, and thanks much for the correction.

    For @drghty , just to make sure you understand why Mark’s correction is potentially important, depending on the total content of your text file, my FIND pattern .{5}$ would also match up to five consecutive newline sequences, if your file has multiple consecutive newlines, if it does not include (?-s), or you don’t have . matches newline disabled.

  • Search results editing

    6
    0 Votes
    6 Posts
    677 Views
    Alan KilbornA

    @Tylor-J said in Search results editing:

    I have the same issue.

    If you have a nice, easy reproducible case, probably showing it here helps.

  • Regex mask a list of emails?

    2
    0 Votes
    2 Posts
    631 Views
    guy038G

    Hello, @kraddock and All,

    For your first goal, I propose this regex S/R :

    SEARCH (?!^).(?=.*.@)

    REPLACE *

    And you end up with this OUTPUT text :

    e****1@gmail.com s***********l@icould.com t********l@yahoo.com

    For your second goal, I propose this regex S/R :

    SEARCH (?!^).(?=.*@)

    REPLACE *

    And you end up with this OUTPUT text :

    e*****@gmail.com s************@icould.com t*********@yahoo.com

    For each case, check the Regular expression search box !

    Best Regards,

    guy038

  • ftp migrate

    3
    0 Votes
    3 Posts
    836 Views
    PeterJonesP

    @Alan-Kilborn said in ftp migrate:

    I’d guess NppFTP does as well.

    Confirmed: there is a subfolder, %AppData%\Notepad++\plugins\Config\NppFTP which contains multiple files as well as a Cache folder under that. If you want the settings, you just need to copy the %AppData%\Notepad++\plugins\Config\NppFTP\NppFTP.xml to the new pc – the other files are just “certificates” and “known hosts” which will be automatically generated the first time you connect to a given site; and the Cache\ subfolder is just for holding the local copies of the remote files you are editing.

  • Reordering keywords saved for 'Find What' list of Find functionality

    5
    0 Votes
    5 Posts
    490 Views
    Terry RT

    @Raj-Kadam

    Please don’t create duplicate posts. Your other post should be removed, you can do that. Since your question is a follow on from this series of posts this is where you should ask further questions and get more answers.

    The other post has no frame of reference (preceding posts) so cannot be answered by anyone without reading this series of posts.

    But to answer your last question, it’s the %appdata%\Notepad++ that is the “normal” location for the config.xml. Please read the FAQ post What is %AppData% for more information.

    Terry

  • Macros doesn't work on the newest version

    3
  • Help to replace a specific text

    4
    0 Votes
    4 Posts
    255 Views
    ParallaxedP

    Thank you both for responding. I have followed your advice and finally I have been able to do it using Excel, much easier than I imagined. Thanks again!

  • Stopped remembering current session

    3
    0 Votes
    3 Posts
    383 Views
    PeterJonesP

    @AeOeAa said in Stopped remembering current session:

    Hi

    I’ve changed the location of my ++ (to the portableapps.com subdirectory) and … does not work. … Any guesses to what I’ve changed or need to change?

    What needs to change? Stop using PortableApps dot com. They change applications in strange and unknown ways, and they don’t bother to test if their changes mess up the applications they are changing.

    For some applications, PortableApps provide a service, since those apps don’t come with a pre-built portable version. But Notepad++ has had its own portable distribution for as long as I can remember (it has definitely had it since at least v6.0 in 2012, and the doLocalConf, per github history, has been around since before Notepad++ was added to github in 2009), so there is no reason to ever use PortableApps’s changed version of Notepad++. Delete that version, then go to notepad++'s official download at https://notepad-plus-plus.org/downloads/ and grab the most recent zipfile portable from the official location. The PortableApps version of Notepad++ does nothing but cause problems in this forum. Avoid it.

    The official Notepad++ distributions, both installed and portable zipfile, both work correctly for “remember current session for next launch” and “enable session snapshot and periodic backup”.

    Alan answered your question about the directory. If you want to learn more about Notepad++'s backup, and the improvements that can be had by using a properly-configured AutoSave Plugin, please read:

    the User Manual entry on backup settings: https://npp-user-manual.org/docs/preferences/#backup our FAQ: https://community.notepad-plus-plus.org/topic/21782/faq-desk-periodic-backup-vs-autosave-plugin