• How can I mark/bookmark within this selection block?

    3
    1 Votes
    3 Posts
    390 Views
    Chris Tanguay 0C

    Thanks. “Longer answer” works for me!

  • 0 Votes
    7 Posts
    363 Views
    Eric EttingerE

    @Alan-Kilborn said in Remove CRLN *if* next line DOESN'T start with particular character (trying again):

    So you tried exactly what I suggested and it didn’t work for you?
    And then you started changing it?

    OK. I found the problem. I’m a moron. That’s the problem. Instead of asking for clarification I…well…failed to do exactly what you suggested.

    I need to thank you for your patience and assistance!

  • Auto_inst and auto_reg support in notepad++

    3
  • lost files

    11
    0 Votes
    11 Posts
    658 Views
    Alan KilbornA

    Regarding some of the thoughts expressed in this thread, although I won’t quote any directly:

    I’ve always felt “bad” to “chide” users into naming their tabs/files with a hard-name in their file system, to protect their data. No program or operating system or computer should ever lose a user’s data. Notepad++ of course should never lose track of data even if a user wants to keep it in “new 1” for a decade or more.

    But the truth is, crap happens, and the best defense is to name your files so that they appear as normal files in the operating system’s file viewer (e.g. Explorer) and then have a backup strategy that copies the files to an alternate physical device or location.

  • function list not working for lua script

    4
    0 Votes
    4 Posts
    624 Views
    N

    @PeterJones Your code helped me too.

  • Halving multiple numbers

    3
    0 Votes
    3 Posts
    229 Views
    PeterJonesP

    @Torn-22 ,

    Further to @Terry-R’s suggestion, if you search for “add_1”, you will find examples of such calculation (because the PythonScript documentation has an example that adds one to each integer found). All you have to do is take that add_1 example and switch + 1 to / 2 to change from adding 1 to dividing by 2 (halving).

  • How to mark lines with under "x" characters after : in a line.

    21
    2 Votes
    21 Posts
    9k Views
    guy038G

    Hello, @hoang-ngoc, @peterjones and All,

    The following single search regex could be used and, with an empty replace field, would delete any line with a valid user-name :

    SEARCH (?i-s)(?=^[a-z0-9])(?=.*[a-z0-9]:)(?=.*[a-z].*:)^[a-z0-9_.-]{6,15}:.*\R?

    REPLACE Leave EMPTY

    Notes :

    The (?i-s) forces an insensitive search process and the regex dot . standing for a single standard character

    Then the main part is ^[a-z0-9_.-]{6,15}:.*\R? which searches for 6 to 15 chars, before a colon which can be, either, a standard letter or digit, an underscore, a period or a dash, followed by the remainder of current line and a possible line_break

    This part will be valid ONLY IF, in addition, these three lookaheads are TRUE, at beginning of current line :

    A letter or digit begins the user-name ( part (?=^[a-z0-9]) )

    A letter or digit ends the user-name ( part (?=.*[a-z0-9]:) )

    The user-name contains, at least, ONE letter ( part (?=.*[a-z].*:) )

    So, given this INPUT text :

    short:•••••••• # < 6 chars ThisIs2good:•••••••• # OK Looong_user-name:•••••••• # > 15 chars us@er'NA=ME:•••••••• # NON-VALID chars ok-chr:•••••••• # OK ( 7 chars and ALL chars ALLOWED ) ABCD-FGHI_12.34:•••••••• # OK ( 15 chars and ALL chars ALLOWED ) 1234-6789:•••••••• # NO letter .User-Name:•••••••• # NON-VALID char at START USER.NAME_:•••••••• # NON-VALID char at END 1ok_again2:•••••••• # OK

    After the replacment, it would remain :the following OUTPUT text :

    short:•••••••• # < 6 chars Looong_user-name:•••••••• # > 15 chars us@er'NA=ME:•••••••• # NON-VALID chars 1234-6789:•••••••• # NO letter .User-Name:•••••••• # NON-VALID char at START USER.NAME_:•••••••• # NON-VALID char at END

    Best regards

    guy038

  • Notepad++ for macbook m1

    4
    -2 Votes
    4 Posts
    2k Views
    Jacky JoyJ

    @PeterJones said in Notepad++ for macbook m1:

    @Тимофей-Козак ,
    No.
    It’s a Windows application, written with the win32 api.

    thanks for the awesome information.

  • how to copy lines adjacent to bookmark lines?

    3
    -2 Votes
    3 Posts
    214 Views
    ghost 001985G

    thank you!

  • Delet specific part of the line

    3
    0 Votes
    3 Posts
    353 Views
    martin sedlacekM

    Thank you so much. Your answer helps me understand how these shortcuts work and solved my problem.

    Thanks for help.

  • how to delete everything after log in combo on multiple lines

    3
    0 Votes
    3 Posts
    174 Views
  • How to delete all lines found in another txt document in notepad++

    4
    0 Votes
    4 Posts
    1k Views
    Alan KilbornA

    @PeterJones

    Here’s one that is very similar to this current question:

    https://community.notepad-plus-plus.org/topic/20443/deleting-numbers-from-list-1-that-also-appear-in-list-2

    A posting in that thread links to a PythonScript solution here:

    https://community.notepad-plus-plus.org/post/54316

  • 0 Votes
    2 Posts
    177 Views
    PeterJonesP

    @ShamithaSIlva ,

    Regarding the save, there is a known bug in v8.1.1 and v8.1.2 . It has been confirmed fixed on v8.1.3, which is currently at release candidate 3, though will hopefully be released soon.

    For the FIND menu, maybe the v8.1.3-RC3 will fix it for you, too. But I’ve never had problems pasting into the FIND WHAT textbox, so I cannot confirm that the problem exists.

  • add text in multiple files

    3
    2 Votes
    3 Posts
    440 Views
    Stefano SchiaviniS

    thank you,

    exactly what I needed.
    works great.

    Stefano

  • Encapsulating specific lines with angle brackets

    4
    0 Votes
    4 Posts
    2k Views
    PeterJonesP

    @guy038 ,

    I agree with your interpretation. I just didn’t see enough in my first reading to get that far.

    Because the original post didn’t show a “before” and “after” state, I missed the “every line that starts with @” portion. Since I didn’t see enough information, I gave a brief reply that introduced the concepts required, and linked to the appropriate reading for those concepts.

    But yes, doing it my way with the “every line that starts with @”, I would change my FIND to (?-s)^@(.*)$ and the full replacement would be <$1>.

    For @Elnaz-Kia ,

    The substitution escape sequences section of the same usermanual page briefly describes @guy038’s $0 notation and my $1 is described in the section on $ℕ in the document. Both are essentially equivalent, with @guy038 making use of the automatic “whole match” capture group and mine using an explicit capture group.

  • Sign not showable?

    3
    0 Votes
    3 Posts
    158 Views
    BlackMage2B

    Many thanks! That helped. :D

  • Chapter Headings

    2
    0 Votes
    2 Posts
    1k Views
    PeterJonesP

    @Dave-Clark ,

    A text file knows nothing about chapters, headers, or the like. It is a series of bytes which are all interpreted as text (hence the name “text file”).

    I don’t know about the Kindle formats in particular, but when I’ve looked into open-source EPUB format, it is basically a zipped collection of HTML and associated images.

    So maybe if you wrote your text file as HTML, using HTML syntax for headings (<h1>, <h2>, …), that would give you what you need.

    But none of this is really on-topic here, because the answer would be the same whether you use Notepad++ (which you should), or Windows notepad.exe (shudder), or copy con textfile.txt () to edit your file.

  • 0 Votes
    2 Posts
    242 Views
    EkopalypseE

    @stmav
    Sorry, but this is hardly possible with the built-in UDL since parts
    are dynamic and UDL does not provide regex terms to identify different parts.
    You have to write your own lexer for this case.
    A scripting plugin like PythonScript can be used to make this possible.
    If you are familiar with another programming language there may be ways to use it as well.

  • 0 Votes
    6 Posts
    377 Views
    guy038G

    Hello, @robin-cruise and All,

    In the search regex (?s)(https://xxx.com/en/)([^"]+)".+?\1(?!\2").+?" :

    The regex part https://xxx.com/en/ looks for the literal string https://xxx.com/en/, stored as group 1

    The regex part ([^"]+)" represents the remainder of the internet address ( for instance the string page-AAA.html ), followed with a double-quote, because [^"]+ is a non-null range of consecutive chars, all different from ", stored as group 2

    Now, the part .+? stands for the shortest range of any char till…

    The group 1 ( \1 ). So an other string https://xxx.com/en/

    Which must be followed by .+?", which represents the shortest non-null range of any char before a double-quote

    But ONLY IF this range is different from \2 ( i.e. different, for instance, from the string page-AAA.html and a " char )

    Note also that the [^"]+" syntax, without the parentheses, is more restrictive than .+?" and must be preferred because of the negative look-ahead (?!\2")

    Besst Regards,

    guy038

  • Please need a multiple renewable change

    5
    0 Votes
    5 Posts
    392 Views
    guy038G

    Hello, @patrick-rozon , @peterjones , @terry-r and All,

    Here is my solution. Not ideal, of course, as it would be suitable for small file size, only, but quite flexible !. It also uses a dummy character, not present in current file. I presonally chose the ¤ char of my French keyboard but, of course, any other char may be used

    Add a line ¤123456 at the very end of current file

    SEARCH (?s)&(.*¤)(\d)(\d+)|¤\d+

    REPLACE ?1\2\1\3\2

    Tick the Wrap around option

    Select the Regular expression seardh mode

    Hit, repeatedly, on Alt + R ( Replace button ) OR on Alt + A ( Replace All button ) till one of the follwing messages occurs :

    Replace: one occurrence was replaced. No more occurrences were found.

    Replae All: 0 occurrences were replaced in entire file

    One advantage of this method is that you may change, either, the modudlo and the values, without changing the regex S/R ! For instance, let’s suppose you want to replace any & char, by any even number ( so, modulo 5 ), in decreasing order, Then, simply add the line ¤86420 at the very end of the file and just use the regex S/R mentionned above !

    So, from the INPUT text :

    ------------&--------------&----&&-----------------&----------------&----- ------------&--------------&----&&-----------------&----------------&----- ------------&--------------&----&&-----------------&----------------&----- ¤86420

    After 19 replaceemnts, we would get the OUTPUT text :

    ------------8--------------6----42-----------------0----------------8----- ------------6--------------4----20-----------------8----------------6----- ------------4--------------2----08-----------------6----------------4-----

    Best Regards,

    guy038