• Regex: I cannot find and replace unless I copy to another file

    3
    0 Votes
    3 Posts
    185 Views
    Mark OlsonM

    @Terry-R said in Regex: I cannot find and replace unless I copy to another file:

    I think \r is linux and \n is Mac

    other way around, \n is Linux (and also cmd and Powershell) and \r is Mac.

  • Add A Word in Between A Phrase And A List of Values

    2
    1 Votes
    2 Posts
    638 Views
    PeterJonesP

    @ZaneChiwawaUTAU ,

    Thank you for showing before and after data in the code blocks.

    You have to use a feature called “regular expressions”.

    In your instance, it looks like you want to put your character right before the first comma in each line.

    FIND WHAT = ^([^\r\n,]*), REPLACE WITH = $1強, SEARCH MODE = Regular Expression

    The FIND of the regular expression will look for the beginning of the line (^), followed by 0-or-more (*) of the characters that aren’t CR, LF, or comma ([^\r\n,]), followed by a comma. Everying inside the (...) parentheses will go into group#1 for storage

    The REPLACE starts with the contents of group#1 ($1), which will be the first field of your line, followed by the literal text 強, followed by a literal comma.

    This is just one of the multitudes of things you can do with Regular Expressions. Look up each of the tokens I shared in the online User Manua’s Searching/Regex section linked below, to learn more about what they do, and to see other similar things that can be done.

    Useful References Notepad++ Online User Manual: Searching/Regex FAQ: Where to find other regular expressions (regex) documentation
  • UDL property colorization and autocompletion

    3
    0 Votes
    3 Posts
    248 Views
    EkopalypseE

    @swegmike

    Just a note, you could also use the plugin, EnhanceAnyLexer, of which I am the author, to make this happen.

  • Creating a custom toolbar.

    4
    0 Votes
    4 Posts
    2k Views
    HatschipuhH

    @Karlo-F Wow the plugin NppSnippets is great!

  • Changing language association of file extension

    6
    0 Votes
    6 Posts
    1k Views
    jofe95J

    @PeterJones
    OK, after reopening the *.inc file, it seems to work now. Thank you!

  • RegEx help - find & replace specific word at the end of a line

    4
    0 Votes
    4 Posts
    1k Views
    JustinJudoJ

    @Alan-Kilborn said in RegEx help - find & replace specific word at the end of a line:

    Find: (?-s)^(.+?), The$
    Replace: The ${1}

    That’s exactly it! Thank you Alan.

  • Macro to Replace Whole Word

    7
    0 Votes
    7 Posts
    363 Views
    Mark OlsonM

    @MaximillianM
    Glad it’s working now! Very strange that you were having this problem.

  • Sort Lines Lexicographically did not work

    61
    1 Votes
    61 Posts
    25k Views
    CoisesC

    @Cooeeeee said in Sort Lines Lexicographically did not work:

    I’ve been using Notepad++ for years. My most used feature is Sort Lexicographically to sort a column mode selection (i.e. I essentially have a table of data). For example, I’ll use Alt+Shift and maybe select columns 27-30 across all lines, then do a lexicographical sort on that.

    Today I encountered a list that wasn’t sorting correctly. I’ve not had this problem before. My lines had some tabs prior to the columns I was trying to sort. Reading through this thread gave me the idea to try the “TAB to space” conversion. My listed would sort correctly after making that adjustment. Somehow the tabs were breaking it. I figured I’ll leave this tip here in case it can help anyone else.

    Indeed, sorting by column does not work if there are tabs before the columns. No doubt for efficiency, the column sort in Notepad++ determines a single pair of starting and ending character positions to apply to all lines, rather than independently extracting the selected text on every line; tabs are treated as single characters, no matter how wide they are on the display.

    If you’re interested in a pre-release version of a plugin, Columns++ includes a sort function which works as expected when there are tabs in the document.

  • search replace wildcards

    2
    0 Votes
    2 Posts
    178 Views
    Alan KilbornA

    @R-Harms

    Hmmm…wildcards…are you sure you read the manual?

  • Notepad++ rolling back to older version at every restart

    2
    0 Votes
    2 Posts
    504 Views
    PeterJonesP

    @Francesco-Saltalamacchia ,

    Any idea why?

    Two ideas:

    Your institution installed in location X, but you installed to location Y, so when you reboot and start Notepad++, you are running the location-X version rather than your location-Y version. To prove this: after doing your installation, look at ?-menu Debug Info and note the path after your reboot and running Notepad++, look at the same info. Are they the same or different? Your institution force-installs the v7.9.1 after you installed “the latest” (whichever version that is.) the same substeps from #1.1-2 would work here for helping to see if the version is changing but running from same location.
  • Saving Compare output to a file.

    3
    0 Votes
    3 Posts
    19k Views
    Daniel HolzmannD

    Apologies for being very late to this party, but I was exactly looking for an answer to this question.
    I wanted to share my workaround for not being able to export comparison results in Notepad++. I used the compare function in MS Word instead, which achieved this.

  • Translate document?

    2
    0 Votes
    2 Posts
    435 Views
    PeterJonesP

    @Ivikdor ,

    The Translate plugin is a 32-bit-only plugin that hasn’t been updated since 2015. If you have the 32-bit Notepad++, it will show up in your Plugins Admin; since you say you don’t see it, I am assuming you have the 64-bit Notepad++ instead.

    But since the plugin hasn’t been updated since 2015, even if you were to switch to 32-bit Notepad++ (which I don’t think is really a good idea), it is highly likely that the plugin would no longer be compatible, because Notepad++'s plugin interface and underlying interactions have changed significantly in the last eight years, and the chances are that some or all of the features as implemented are not compatible with modern Notepad++.

  • Using the PythonScript plugin to automate N++

    53
    0 Votes
    53 Posts
    6k Views
    Alan KilbornA

    @TBugReporter said in Using the PythonScript plugin to automate N++:

    I’m not sure whether you’re way overthinking this, or I’ve way underestimated the possibilities

    I don’t know… You posed a fairly reasonable desire, and I put some reality onto some potential problems with getting to where you wanted to go.

    Better to expose the “real world” of it, if it is known, before trying to solve the problem…, which we are now NOT going to do. :-)

  • shortcuts.xml in notepad++

    8
    0 Votes
    8 Posts
    3k Views
    TBugReporterT

    @PeterJones said in shortcuts.xml in notepad++:

    Whine at @Alan-Kilborn because he keeps teasing his new script without making it public Kindly remind @Alan-Kilborn that he hasn’t published his script yet

    @Lycan-Thrope said in shortcuts.xml in notepad++:

    In other words, you’re trying vainly to fool-proof it.

    Could it be that there’s another person on here who’s guilty of letting the “perfect” be the enemy of the “good”? Shocking! 😯

    @Alan-Kilborn said in shortcuts.xml in notepad++:

    No, just trying to find the time, amid other projects, to finish it.

    Send me a copy - I’ll finish it for you (but it’ll be 10Mb when I’m done)! 😁

  • Difference in regular expressions between Search and Function List?

    4
    0 Votes
    4 Posts
    620 Views
    RobertER

    @PeterJones Just wanted to let you know that after I closed down Notepad++ and reopened it, now the Function List works perfectly in all files. Thanks again.

  • my css code for color not working and error message when run

    5
    0 Votes
    5 Posts
    2k Views
    Lycan ThropeL

    @Michelle-Vedros ,
    In addition to what @PeterJones has pointed out to you, your code doesn’t work, even when you use the Notepad++ menu’s View->View Current File in->(browser choice) to view it. That’s because your code is in error. You need to consult an HTML/CSS/Javascript site, like the W3C Schools courses to better learn what you did wrong. I tried your code that way and in both Chrome and Firefox and it did exactly what you coded it to do. It just didn’t do what you wanted it to do, and that’s why I’ve just given you the link you need to follow to learn how to do it right.

  • Need Regex to Delete HTML attribute

    6
    1 Votes
    6 Posts
    1k Views
    Mark OlsonM

    Lycan-Thrope’s response is adequate for your needs as stated, and has the added bonus of being (probably) fast to execute and easy to understand.

    But if you’re curious, here’s an alternative that minimizes side-effects:
    replace (<a[^>]*?)\s*title\s*=\s*".*?"([^>]*?>) with \1\2.

    Before:

    <a href="fjoenr" title="oenrwn"><i title="eorn">eron</i></a> <a title = "eroeno">foenfeonf title="eoeno"</a> <p>title="Ereoneorn"</p> <a href="eoenoen"></a>title="eoenon" <a title="eoenon" href="eoenroenro">""</a>

    After:

    <a href="fjoenr"><i title="eorn">eron</i></a> <a>foenfeonf title="eoeno"</a> <p>title="Ereoneorn"</p> <a href="eoenoen"></a>title="eoenon" <a href="eoenroenro">""</a>
  • Invisible the cursor/Caret in V8.4.8

    2
    0 Votes
    2 Posts
    170 Views
    PeterJonesP

    @Sáfián-Lajos

    Cannot reproduce.

    Light mode, Deep Black theme: cursor not invisible – I can see it in this screenshot between not and invisible:
    96867134-0fcd-41a2-91b2-6b18ac0fb9e5-image.png

    Dark Mode, Deep Black theme: cursor not invisible – I can see it in this screenshot between n and v in invisible:
    8eb59743-661a-472d-a334-59bbe2e8c2e1-image.png

    Please note that theme is irrelevant: the colors of the Find dialog are set by the Light Mode / Dark Mode, not by the Theme.

  • How to combine two text documents to fill in blank lines

    10
    0 Votes
    10 Posts
    554 Views
    Alan KilbornA

    In my previous posting, I used the regular expression \d\d a few times. This was because that “fit” the test data I was working with (had 9 < #lines < 100).

    If OP has a different number of lines in his real world scenario, which is likely, probably a better expression is \d+.

    Again, when help is provided here, it may not be an exact fit for a situation that is not explicitly mentioned in the questioner’s problem statement, and may need to be adjusted, but the general solution technique should be solid.

  • Add row-gap property in langs.xml/CSS language

    Locked
    1
    0 Votes
    1 Posts
    269 Views
    No one has replied