• copy all mobile numbers starting with 9

    4
    0 Votes
    4 Posts
    877 Views
    Paul WormerP

    @guy038 Thank you. I always overlooked the button Copy Marked Text. Now I understand that it copies to the clipboard, good to know!

  • 0 Votes
    7 Posts
    346 Views
    guy038G

    Hello, @datatraveller1 and All,

    No, I think that your regex S/R is just the right one and cannot be improved significantly ;-))

    Perhaps it’s good to recall that, at the end of your replacement string, you must insert \r\n if you use Windows files OR \n if you use Unix files

    An other formulation would be to split out this S/R in two individual S/Rs :

    SEARCH [([0-9])],?

    REPLACE $1\)\);\r\n

    Then :

    SEARCH (?-s)^(?=.)

    REPLACE System.out.println\(dataStream.consec\

    But, no advantage for doing this as the first search regex is identical in the two cases !

    Best Regards,

    guy038

  • Filter data

    9
    0 Votes
    9 Posts
    1k Views
    datatraveller1D

    @Alan-Kilborn Great, Thank you!

  • find missing closing brackets

    2
    0 Votes
    2 Posts
    2k Views
    PeterJonesP

    @Mary-Cook ,

    It would be the same, except use \\[ or \x5B instead of the first quote (for the part where you want to match the opening bracket). And \\] or \x5D instead of the closing quote (to match the closing bracket).

    Or if you mean () for brackets, then use \( or \x28 for the opening parentheses, and \) or \x29 for the closing parentheses.

    Or if you mean {} for brackets, then use { or \x7B for the opening curly brace, and } or \x7D for the closing curly brace.

    User Manual: Regular Expressions
  • Delete spaces not followed by characters

    5
    0 Votes
    5 Posts
    674 Views
    G

    @Alan-Kilborn

    This one works perfectly

    Thanks again for your help !!

  • More space at the left of the first column

    13
    0 Votes
    13 Posts
    1k Views
    Alan KilbornA

    @guy038 said in More space at the left of the first column:

    And to get the very end of current line, in all cases, affect a shortcut to the Scintilla command SCI_LINEEND

    That reminds me of some related discussion as part of this thread: https://community.notepad-plus-plus.org/topic/23381

  • How do I move bookmarks to a copy of the same file?

    20
    0 Votes
    20 Posts
    2k Views
    Paul WormerP

    @Paul-Wormer
    I prepared a pedestrian script that mimicks the all command of Xedit and Kedit. Just like those two editors (that both date from before color screens came into existence) my script doesn’t do any coloring. I hope that the bug in the Scintilla routine hideLines is circumvented by invoking it twice. [During my writing of the script, it indeed happened several times that not all lines were hidden after issuing editor.hideLines(0, int(editor.getLineCount())-1 )].

    Here comes the script:

    # -*- coding: utf-8 -*- from __future__ import print_function # Python 2.7 from Npp import * def disp_only_lines(string_to_show): ''' Display only the lines that contain `string_to_show`. ''' Lines_to_show = set() def handle(m): Lines_to_show.add(editor.lineFromPosition(m.start())) # Loop over whole file, calling `handle` for each find: editor.search(string_to_show, handle) # Sort numbers of lines containing `string_to_show`: Lines_to_show_sorted = sorted(list(Lines_to_show)) # Hide all lines (twice because of bug in Scintilla): editor.hideLines(0, int(editor.getLineCount())-1 ) editor.hideLines(0, int(editor.getLineCount())-1 ) # Actual showing of lines to be shown: for line_shown in Lines_to_show_sorted: editor.showLines(line_shown, line_shown) def tab_callback(args): ''' Called after return from other tab. ''' global save_bufferID, display_all, string_to_show if save_bufferID == args['bufferID'] and not display_all: disp_only_lines(string_to_show) #### Main #### save_bufferID = notepad.getCurrentBufferID() notepad.clearCallbacks(tab_callback) notepad.callback(tab_callback, [NOTIFICATION.BUFFERACTIVATED]) # Role of boolean `display_all`: # if true all lines are displayed, else some lines are hidden. try: if display_all: string_to_show = editor.getSelText() editor.setEmptySelection(editor.getCurrentPos()) # Undo selection except NameError: # First time in, `display_all` does not exist display_all = True string_to_show = editor.getSelText() editor.setEmptySelection(editor.getCurrentPos()) # Undo selection if len(string_to_show) == 0 and display_all: notepad.messageBox('No string selected', 'all.py') else: if display_all: disp_only_lines(string_to_show) display_all = False # Not all lines are displayed else: editor.showLines(0, int(editor.getLineCount())-1 ) display_all = True # All lines are displayed string_to_show = ''
  • replacing a specific text from a another file

    14
    0 Votes
    14 Posts
    3k Views
    fenzek1F

    Thank you guys.
    For your feedback to me.
    I will study the subject of “regular expressions” in more detail.

    If it applies to my work and makes it VERY easy, then I must know something about it right.

    I’ve looked at your answers before, and they’ve helped me with other obvious things, but obviously I didn’t understand anything about coding,
    Still, your altruism and help made sense to me.
    And the way you help people is nothing but respect.
    Thank you from the bottom of my heart.

    I understand that old-timers are willing to give a year, a couple of years, or even a decade to learn.
    And then someone like me shows up and “help me do it for me,” no, that’s not it, and that’s not the plan I had when I started my thread.

    You showed me, and for that I want to say thank you.

  • Fold/Unfold is acting inconsistently.

    3
    1 Votes
    3 Posts
    263 Views
    ludamo 0L

    Yes I noticed something like this recently. I folded a few functions in a large AHK file (over 3000 lines), then started to add a new function below the folded ones and seemed to lose the folded functions? Fortunately multiple undoes saved me from starting from a backup.
    I tried it again just now but couldn’t replicate it. I am using version 8.4.8.

  • user defined languaje dialog, multiline comments

    3
    0 Votes
    3 Posts
    327 Views
    carlos CharlyC

    @PeterJones Thank you! Using EnhanceAnyLexer plugin In 10 minutes I colored my special multiline comments! Good solution!

  • Custom IntelliSense For Objects

    2
    0 Votes
    2 Posts
    538 Views
    EkopalypseE

    @pgSystemTester

    Npp is a general purpose editor and has no reflection/inspection built in for any programming language. But it does have the ActiveX plugin that allows JavaScript to manipulate Scintilla’s calltip and autocomplete objects at runtime.
    Another option would be to use my LSP client, but that means you need to have an LSP server running for JavaScript, since I don’t work with Java/JavaScript I haven’t tested/investigated that.

  • Problems with printing from Notepad++

    6
    0 Votes
    6 Posts
    7k Views
    Alan KilbornA

    @R-W said in Problems with printing from Notepad++:

    I got it to work by:
    Goto Preferences
    Margins/Boarder/Edge
    Uncheck Display Change History

    This thread predates the existence of Change History as a feature, so of course the posts above don’t mention it. More on Change History, including interaction with printing, can be found in its FAQ entry.

  • Hating document switching window hotkey

    6
    0 Votes
    6 Posts
    275 Views
    Alan KilbornA

    @Владислав-Пестриков said in Hating document switching window hotkey:

    i cant disable its invocation by mouse.

    How are you invoking that popup window via the mouse?

  • deleting whole lines

    2
    0 Votes
    2 Posts
    144 Views
    Alan KilbornA

    @kracovwolf

    Match lines containing an open parenthesis (somewhere) followed by a closing parenthesis (somewhere after the opening one) with:

    Find what: ^.*?\(.*?\).*\R
    Search mode: Regular expression

  • Help about prefix and quotes

    5
    0 Votes
    5 Posts
    718 Views
    Pablo Hugo RedaP

    @Ekopalypse Thank’s !!

  • Need Help Comparing Two Text Files

    2
    0 Votes
    2 Posts
    719 Views
    datatraveller1D

    @usamarslan I’m afraid Notepad++ isn’t the right tool to do your task. It sounds like you need a tool for joining CSV files like the freeware command line tools xsv (https://github.com/BurntSushi/xsv) orlistcompare (https://mg-tools.weebly.com/). However, probably no tool can do exactly what you want. In this case, you need to write a script (e.g. in Python) to fulfil your requirements.

  • Functionlist parsing issues, language specifics.

    4
    0 Votes
    4 Posts
    335 Views
    Lycan ThropeL

    @swegmike ,

    Putting this as delicately as I can, when I was developing my UDL, I ran into the same problem. Solution: Do it the way the functionList regex(boost) does it. Which means, learn the boost or rather, the NPP way of doing it. Stop trying to compare apples and oranges to get what you want done by insisting on shoehorning some other tool into it.

    Regex101.com is a great resource for someone learning regex and trying things out to interactively see how different combinations help to achieve results…but since they even have mutiple ‘flavors’ of regex, that should tell you something right there. There is no one only option. You take the good with the bad…and in this case, they don’t offer their site with a boost version. Unfortunately for you, they also don’t write Notepad++, and currently, NPP uses the Boost regex engine for whatever reason the developers chose to use it. Since Regex101.com doesn’t offer you a way to write a functionList for NPP…you’re stuck having to learn the tool this tool chose to use or forego the tool.
    I get it, it was a setback for me also and I had to learn to use the NPP/Boost, and I had a lot of help from these folks here on how to get it to work to do what I wanted, but that’s because they’re familiar with this tool, using these tools, and have developed similar things also. So…best advise, is to buckle down and start using the present tools, rather than dream of a perfect world. :) No sense wishing, when you can make a suggstion for future use, but presently use and learn the tools available. I’m still a newbie regex user, and regex101.com is my choice for interactive development of a regex, but at the end of the day, it helps me get 90% of the way there, but I still have to finish it in Boost…so…I do.
    Happy New Year to you and all the fine folks here who are willing to help you use the tools available NOW. :)

  • How can I turn off Change History

    22
    1 Votes
    22 Posts
    9k Views
    Alan KilbornA

    @Bigfootmech

    if I launch the old one, the “off” setting gets reset on the new version, turning display history back on

    This situation causes both to use the same settings, because there is only one copy of the settings on your PC.

  • How to stop Notepad++ intercepting back/forward keypresses?

    6
    0 Votes
    6 Posts
    3k Views
    Alan KilbornA

    @Alan-Kilborn said in How to stop Notepad++ intercepting back/forward keypresses?:

    The “forward” button does the “find next” and the “backward” button does the “find previous”.

    I’ve decided that to me tying the functionalities this way doesn’t make sense. The “forward” button on the mouse is toward the top of the mouse, with the “backward” button closer to me. So, my thinking is that the further button should do the find-previous and the closer button should do the find-next. Thus, I’ve changed the code to swap the functionalities.

    BTW, my fancy new mouse also has a horizontal scroll wheel, in addition to the normal vertical one:

    7f541264-85bd-4d1e-b9c6-4056b029e868-image.png

    When I try this h-wheel with Notepad++ (and other apps), I find that the scroll direction is the opposite of what I expect! (And that the scrolling isn’t “fast enough” but that’s a different thing). So, another script took care of “fixing” the h-scroll direction…for N++ at least (don’t see myself using h-scroll in other apps).

    Probably installing the add-on s/w for the mouse allows me to configure such things; I don’t normally do that but with this mouse’s advanced features, I just might.

  • please help me let my chat control my game

    2
    0 Votes
    2 Posts
    317 Views
    PeterJonesP

    @Gabr-Care said in please help me let my chat control my game:

    i am trying to learn how to use the notepad++

    You open a file in Notepad++ and start typing. If you want to do advanced stuff, go to the ? menu and choose the Online User Manual. If you have specific questions, feel free to ask them here.

    Hello i am new to coding …

    https://community.notepad-plus-plus.org/topic/15958/faq-desk-you-ve-asked-your-question-in-the-wrong-place