• Replace text on certain lines only - Column Editor

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    PeterJonesP
    Using example data from another thread… Gui, Add, Button, x22 y150 w90 h20 , Button 1 Gui, Add, Button, x22 y170 w90 h20 , Button 2 Gui, Add, Button, x22 y190 w90 h20 , Button 3 # dummy line, different than the rest Gui, Add, Button, x22 y210 w90 h20 , Button 4 Gui, Add, Button, x22 y230 w90 h20 , Button 5 Gui, Add, Button, x22 y250 w90 h20 , Button 6 Assuming you wanted all the x22 replaced with x314, Search > Replace..., with ☑ Regular Expression Find What = (?-is)\bx22\b Replace with = x314 Assuming you wanted all the various y### replaced with the same y2718, Find What = (?-is)\by\d+\b Replace with = y2718 Assuming you wanted all the various y### replaced with a variety of y-numbers, depending mathematically or logically on the value of the original y###, you would use the PythonScript plugin and a variant of the script I showed in that other thread With no data examples given, we cannot tailor the response to your data. P.S. : (paraphrasing @guy038, the forum’s regex guru, who compiled these great regex resources, but hasn’t shared them in this thread yet): Here is a good starting point for NPP users unfamiliar with regular expression concepts and syntax: http://docs.notepad-plus-plus.org/index.php/Regular_Expressions Modern Notepad++ (since v6.0) uses the Boost C++ Regex library, v1.55.0 (similar to the Perl Regular Common Expressions (PRCE), v5.8): search syntax: http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html replace syntax: http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html Other sites with valuable regular expression information include: http://perldoc.perl.org/perlre.html http://www.regular-expressions.info http://www.rexegg.com
  • Replace Help

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    BortfiveB
    @guy038 i will try it, u are the best bro <3
  • Insert a string after each number of words with conditions

    19
    0 Votes
    19 Posts
    13k Views
    abuali humaA
    I modified the original Search regex, as it catches some Unicode characters with will break the line in a middle of a word. So in the modified regex I replace \W with \x20 (space character)… so far no word breaking issues Here is the modified one (?-s).{1,44}(?=\x20)
  • How to hide methods bodies closed when Notepad++ opens file?

    Locked
    1
    0 Votes
    1 Posts
    726 Views
    No one has replied
  • High-lighting text

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    古旮
    Search -> Mark…
  • Typing problem

    Locked
    1
    0 Votes
    1 Posts
    719 Views
    No one has replied
  • windows crashed.. lost all my tabs..

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    mango wodzakM
    Looks like I found them!! They are in the backup folder… panic over!
  • Turkish Language version errors

    Locked
    1
    0 Votes
    1 Posts
    779 Views
    No one has replied
  • Changing windows, actual line go down in the scroll

    Locked
    1
    0 Votes
    1 Posts
    664 Views
    No one has replied
  • Multiple errors building NPP 7.5.6

    24
    0 Votes
    24 Posts
    11k Views
    YaronY
    Hello Claudia, … But is it relevant for your current problem? Understanding why my build crashes and yours does not is actually more important to me than fixing the Doc Switcher issue. I hardly use that feature but I suspect some other features may not work properly as well. Here is the Dump file. The other way would be to put a breakpoint on line 2243… [image: 38174045-b7d788d0-35cf-11e8-945c-3c4cd1534ee0.png] Should I build it as Debug instead of Release? Thank you for further looking into it and for the detailed explanations. I do appreciate that. Best regards.
  • taskbar icon not visible

    Locked taskbar icon x64
    1
    0 Votes
    1 Posts
    953 Views
    No one has replied
  • Very Simple Replace Problem - but Newbie

    Locked
    5
    0 Votes
    5 Posts
    2k Views
    Harry MartinH
    Works! Thank you.
  • Write numbers from one to another one.

    9
    0 Votes
    9 Posts
    6k Views
    dedsec24D
    Thanks all of you I got my answer.
  • Increase/Decrease All Highlighted x or y Coordinates

    4
    0 Votes
    4 Posts
    2k Views
    PeterJonesP
    Sorry, it took me a while to find the time to work on this You need PythonScript and 32bit Notepad++ for this to work. You can download PythonScript here # https://notepad-plus-plus.org/community/topic/15485/increase-decrease-all-highlighted-x-or-y-coordinates # Will prompt for which column (allows x, y, w, h) and how much to add or subtract (requires a number) # Will then do the search/replace over the whole file DEBUG = False def delt_1(m): global addend this = m.group(1) if DEBUG: console.write("matched '") console.write(this) console.write("'\t") r = str(addend + int(this)) if DEBUG: console.write("return: '" + r + "'") console.write("\n") return r #################################################### if DEBUG: console.show() if DEBUG: console.clear() column = None while column != "x" and column != "y" and column != "w" and column != "h": column = notepad.prompt("Which column [x y w h]?", "Choose column", "y") addend = None while addend == None: direction = notepad.prompt("Number to add (negative for subtraction)", "Choose delta", "1") try: addend = int( direction ) except: addend = None if DEBUG: console.write("column: " + column + "\n") console.write("addend: " + str(addend) + "\n") pattern = "((?<=\s{0})\\d+)".format( column ) if DEBUG: console.writeError(pattern + "\n") editor.beginUndoAction() editor.rereplace(pattern , delt_1) editor.endUndoAction()
  • Subtract document B from A

    multi delete subtract batch remove
    21
    0 Votes
    21 Posts
    12k Views
    Claudia FrankC
    @Timmy-M good to see that you got it sorted out :-) and to keep sorting, change this editor1.setText('\r\n'.join(s1-s2)) to this editor1.setText('\r\n'.join(sorted(s1-s2))) that should do the trick. Cheers Claudia
  • How to set browser window height in Notepad ++

    Locked
    2
    -1 Votes
    2 Posts
    1k Views
    Scott SumnerS
    @Jamar-Bivens Nope. This is a place for talking about Notepad++ issues, not web-development issues. Please find a more appropriate place to ask your question–there must be many possible channels for this. And please, nobody answer it here; it only encourages off-topic discussions.
  • Block Editor Insert numbers backwards

    Locked
    1
    0 Votes
    1 Posts
    781 Views
    No one has replied
  • Sindhi translation

    Locked
    1
    0 Votes
    1 Posts
    920 Views
    No one has replied
  • how to find multiple lines in multiple files?

    Locked
    1
    0 Votes
    1 Posts
    741 Views
    No one has replied
  • Unable to see the contents of doc when clicking on Open

    Locked
    8
    0 Votes
    8 Posts
    3k Views
    PeterJonesP
    And for those who (like me) had never noticed the feature, here’s where a picture (or movie) gives a lot of clarity. [image: RIACHJk.gif] Note, I click on the “Details” just to show that I have “Details” selected, but I don’t think it matters (I originally thought you might have to be on “Contents” view, but this movie shows you don’t). The important is clicking on the “Show the preview pane.” icon to the right. That will preview the contents.