• CTRL+H Help Me Please

    6
    2 評價
    6 貼文
    341 瀏覽
    ISMAIL ISMAILI

    @Alan-Kilborn @Nuri-UTKU

    Thanks Nuri, I’ll take that into consideration.

  • Entering curly quote marks as UDL operators, or keywords

    4
    0 評價
    4 貼文
    332 瀏覽
    guy038G

    Hello, @ian-oh, @peterjones, @alan-kilborn and All,

    Sorry for not being very responsive, but I am currently on vacation and consult our forum rather rarely !

    Before presenting the regexes which allow this kind of search, paste the following five lines, in a new tab and let’s study some concepts. Note that line 5 contains a full period

    Start blah “blah blah” “imbalanced open “blah” “imbalanced close” blah” This is a ““Te”st”“““abc”de”fgh. Ijkl”“mnop”” End

    If we’re going to search the longest area, with well balanced delimiters and , we must, first, consider the total range where to search these areas. Let me explain :

    Case A : We may suppose that this range is the file contents ( Default case )

    Case B : We may suppose that this range is limited to current line contents

    Case C : Finally, we may suppose that this range is limited to a single sentence contents, within current line

    If, by convention, any text, without double curly quotes, is considered as well balanced ( zero char and zero char ), we can say that :

    Regarding case A :

    The multi-line area, beginning from word Start, in line 1, till the string “mnop”, in line 5, forms an area with the same number of opening and closing double curly quotes ! ( The last , before End, is not included )

    Then, the final End word, preceded with a space char, is a well-balanced area, by default !

    Regarding case B :

    Line 1 and 2 are well balanced

    Line 3 contains the well balanced area imbalanced open “blah”

    Line 4 contains the well balanced area “imbalanced close” blah

    Line 5 contains the well balanced area This is a ““Te”st”“““abc”de”fgh. Ijkl”“mnop”

    Regarding case C :

    Line 1 to 4 are identical to case B

    Line 5 contains :

    The well balanced area This is a ““Te”st”, in the first sentence

    The well balanced area ““abc”de”fgh, right before the period

    The well balanced area ijkl, preceded with a space char, in the second sentence

    The well balanced area “mnop”

    The well balanced area End, preceded with a space char

    So, if we add +1 for any opening double curly quote and -1 for any closing double curly quote, we get this table, where any char refers to an unmatched double curly quote !

    •--------•---------------------------------------------------• | Line 1 | Start blah | | Count | | •--------•---------------------------------------------------• | Line 2 | “blah blah” | | Count | 1 0 | •--------•---------------------------------------------------• | Line 3 | “imbalanced open “blah” | | Count | • 1 0 | •--------•---------------------------------------------------• | Line 4 | “imbalanced close” blah” | | Count | 1 0 • | •--------•---------------------------------------------------• | Line 5 | This is a ““Te”st”“““abc”de”fgh. Ijkl”“mnop”” End | | Count | 12 1 0•12 1 0 . •1 0• | •--------•---------------------------------------------------•

    Thus, @ian-oh, according to the case A, B or C, you"ll execute the following recursive regexes, in free-spacing mode, beginning at (?x), till the (?1)+ syntax :

    Case A : (?x) (?: ( [^“”] )* ( “ (?: (?1)++ | (?2) )* ” ) )+ (?1)* | (?1)+ Case B : (?x) (?: ( [^“”\r\n] )* ( “ (?: (?1)++ | (?2) )* ” ) )+ (?1)* | (?1)+ Case C : (?x) (?: ( [^“”.!?\r\n] )* ( “ (?: (?1)++ | (?2) )* ” ) )+ (?1)* | (?1)+ ^ ^ | | Groups ---------> 1 2

    Notes :

    These regexes are derived from the end of this article, in the official N++ documentation, which explains how to search for well balanced regions with parentheses :

    (?x) (?: [^()]* ( \( (?: [^()]++ | (?1) )* \) ) )+ [^()]* | [^()]+

    For case C, I considered that a sentence ends at a full period and at an interrogation or exclamation mark. Add other characters to this list if necessary !

    These regexes are mainly composed of non-capturing groups and contain only two groups :

    A non-recursive group 1 which refers to the allowed characters, for each case ( not included the double curly quotes )

    A recursive group 2, as one reference (?2) is located inside the group 2 itself, which adds some intelligence to the overall search by a recursive evaluation of the text

    Note that, in case of incoherent results, it is advised to replace any (?1) syntax by its true value ( [^“”] ), or ( [^“”\r\n] ) or ( [^“”.!?\r\n] ). This may helps !

    Don’t try to perform backward searches : it won’t work !

    Here is an other text of 7 lines, whith a lot of double curly quotes, for additional tests of these 3 recursive regexes :

    ““““ab“““cd““ef”””gh”.ij””klm”””” ““ab““““cd“““ef”””gh””””ijkl”””” ““““““ab“cd“ef“”””gh”ijkl””?”mn””””” ““--ab“cd“ef--gh“ij--kl”mn”o!p““qr--st”uv\wx”--”yz””------”abc abcd--------““efghi----jk”----”lmnop------ ““--ab”cdef--ghi.j--klmn---op““qr--stu”vwx--”yz”---- ---abcde-----““qrs”tu--”vwxyz---

    If you paste these 7 lines in a new tab, you’ll verify that, with the regexA syntax, the last match is all the well-balanced area, below :

    abc abcd--------““efghi----jk”----”lmnop------ ““--ab”cdef--ghi.j--klmn---op““qr--stu”vwx--”yz”---- ---abcde-----““qrs”tu--”vwxyz---

    Which contains, exactly, eight opening characters and eight closing characters !

    Best Regards

    guy038

  • Batch Convert case in multiple open files (maybe regex?)

    11
    0 評價
    11 貼文
    2k 瀏覽
    Chris Tanguay 0C

    @PeterJones That (and as you said, a little patience) worked. The [a-z]+ cuts the time in half.
    Thanks!

  • I cannot download unless I install Driver One. Why is that?

    2
    0 評價
    2 貼文
    246 瀏覽
    PeterJonesP

    @Jim-Lawrence ,

    I don’t know what Driver One is. It is not a prerequisite for Notepad++.

    If you are having difficulty downloading from the official Notepad++ download site at https://www.notepad-plus-plus.org/downloads/ , then maybe your I.T. department is blocking the site, or otherwise requiring it to go through some “nanny” software (maybe that’s what Driver One is) before running a new application on your PC.

    If you are on company equipment, you will need to talk with your IT department to find out if you’re allowed to install Notepad++, and if so, what the proper procedure is for you.

    If you are on your own computer, then I would recommend scanning for virus/malware if you’re seeing something that says “Driver One must be installed” or equivalent. If you have verified you are not infected with anything, then please share the exact steps you are trying in order to download and install Notepad++ (where you are downloading from, exact link URL, etc), and exactly what errors/popups you see.

  • Built in Language to UDL?

    4
    0 評價
    4 貼文
    1k 瀏覽
    EkopalypseE

    @chris-aldridge

    #define … are handled by the preprocessor list and SV_DispatchThreadID … do get colored once I add it to the type word list

    078fecae-0c1f-43d6-83f3-3fd36c317682-image.png

  • Menus are unreadable in dark mode for me

    15
    0 評價
    15 貼文
    3k 瀏覽
    mere-humanM

    Here is a GitHub issue:
    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/10386
    You can see some additional comments there.

  • Installed 8.1.3 Multiple times. Reverts to 7.8.6

    10
    0 評價
    10 貼文
    3k 瀏覽
    Lindsay Cline 0L

    Deleting that directory did the trick; all opens get 8.1.3 now.

    Thanks again!

    Lindsay

  • Edit lnk files

    3
    0 評價
    3 貼文
    6k 瀏覽
    Alan KilbornA

    @James-Rae

    Why can we no longer edit lnk files?

    These files are not text files and Notepad++ is a text file editor.
    A design decision was made to no longer allow editing of the .lnk file itself.

    why would I want to edit the exe file it’s linked to?

    You wouldn’t.
    Presumably, if you were opening a .lnk file in Notepad++, it would point to a text file (which Notepad++ would then open for you).

    the only way I found to edit a lnk file is to change the name of the file the link is connected to, THEN it opens the lnk file to edit (just click no when it asks to delete the shortcut).

    I tried a simple test with this and I found that when I renamed the original file, and then tried opening the .lnk in Notepad++, Windows was smart enough to adjust the link and still find the file, and thus the goal of editing the .lnk file was NOT achieved. :-(

    Deleting the file but keeping the .lnk to it, then works to get the .lnk file itself open in N++, but that’s hardly useful as the original file is gone.

    But…it appears that if you move the original file to the Recycle Bin, then pull the .lnk file into N++, answering “Cancel” to this prompt (a Windows prompt, not a N++ prompt):

    6e1c2905-da34-4fa7-92cf-191877ea7797-image.png

    then the goal of editing the .lnk file can be achieved. Of course, when done editing the .lnk file, get the original file back out of the Recycle Bin.

  • Finding sentences open with “curly” quotation marks and not closed ...

    6
    0 評價
    6 貼文
    644 瀏覽
    Ian OhI

    Sorry, … yes I found my way to an old thread and when I tried to reply it prompted me to start a new thread. I was hoping it would provide some context … but it didn’t, and I didn’t correct it. My apologies.

    I am trying to find mismatched curly quotes. ALT+0147 and ALT+0148 on a PC keyboard. @guy038 RegEx search “(?:[^“”]++|(?0))*” did the trick. It’s pretty good and I’m happy with that. Thank you for pointing that to me.

    UDL will make it more visible… but sometimes it’s too hard to see even when it’s staring me in the face. That’s why I need this Find function. I’ll continue my reply there.

    While @guy038’s solution is good enough, the problem is I could have a missing open curly quote, and it will miss it. So that’s why the UDL would help.

    Thanks for taking the time to respond.

  • Replace all different numbers with a same number

    3
    0 評價
    3 貼文
    10k 瀏覽
    Stealth FighterS

    @guy038 Thank you so much!

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

    3
    1 評價
    3 貼文
    442 瀏覽
    Chris Tanguay 0C

    Thanks. “Longer answer” works for me!

  • Remove CRLN *if* next line DOESN'T start with particular character (trying again)

    7
    0 評價
    7 貼文
    414 瀏覽
    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 評價
    11 貼文
    877 瀏覽
    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 評價
    4 貼文
    719 瀏覽
    N

    @PeterJones Your code helped me too.

  • Halving multiple numbers

    3
    0 評價
    3 貼文
    279 瀏覽
    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 評價
    21 貼文
    10k 瀏覽
    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 評價
    4 貼文
    2k 瀏覽
    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 評價
    3 貼文
    247 瀏覽
    ghost 001985G

    thank you!

  • Delet specific part of the line

    3
    0 評價
    3 貼文
    538 瀏覽
    martin sedlacekM

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

    Thanks for help.