• Regex keyword list

    2
    0 Votes
    2 Posts
    153 Views
    PeterJonesP

    @filipe-Medeiros

    No, it does not.

    However, you can use the EnhanceAnyLexer plugin to use a regex to change the foreground color on words for a UDL.

    Assuming you had a udl called MyUDL, then the config section

    [MyUDL] 0x0000FF = \bword\d+\b 0x00FF00 = \bgreen_\w+\b

    that would color word1 or word987 as red, and anything starting with green_ using a green foreground.

    Using that idea, you could define most of your UDL’s keywords in the normal UDL interface, and add EnhanceAnyLexer to do additional keywords using regex

  • Replacing all spaces between a string and the newline character

    6
    0 Votes
    6 Posts
    382 Views
    guy038G

    Hi @kiyn, @alan-kilborn and All,

    Ah… You right about it, Alan. Sorry, I was concentrating on my example !

    So, regarding the general case and to be rigourous, we should use the generic regular expression itself :

    SEARCH (?-si:BSR|(?!\A)\G)(?s-i:(?!ESR).)*?\K(?-si:FR)

    REPLACE RR

    where :

    FR = \x20 ( a space char )

    RR = %20

    BSR = FILE:///

    ESR = The end of any link, beginning with file:/// or FILE:/// : for example, \.mp3 or \.com|\.us or simply \.\w{2,}

    Notes :

    We can replace the (?-si: modifiers, at the beginning of the regex, by the insensitive modifier (?i: only

    We can omit the (?s-i: modifiers, in the middle of the regex, and keep only the non-capturing group (?:(?!ESR).)

    We can omit the (?-si: modifiers and the non-capturing group, all together, at the end of the regex

    So the generic regex can simply be expressed as :

    SEARCH (?i:BSR|(?!\A)\G)(?:(?!ESR).)*?\KFR

    REPLACE RR

    Thus, the functional regex S/R becomes :

    SEARCH (?i:FILE:///|(?!\A)\G)(?:(?!\.\w{2,}).)*?\K\x20

    REPLACE %20

    And from this INPUT text :

    file:///D:\Documentation\Musique\Marilyne\Amy Winehouse - Back To Black.com first Test Second test file:///D:\Documentation\Musique\Marilyne\Jason Marz|I'm Yours.fr FILE:///D:\Documentation\Musique\Marilyne\Norah Jones - Toes.us. Third test Fourth test file:///D:\Documentation\Musique\Marilyne\Scorpions - Still Loving You.gouv fifth and final test file:///D:\Documentation\Musique\Marilyne\Norah Jones - Wake Me Up.MP3

    We get this OUTPUT text :

    file:///D:\Documentation\Musique\Marilyne\Amy%20Winehouse%20-%20Back%20To%20Black.com first Test Second test file:///D:\Documentation\Musique\Marilyne\Jason%20Marz|I'm%20Yours.fr FILE:///D:\Documentation\Musique\Marilyne\Norah%20Jones%20-%20Toes.us. Third test Fourth test file:///D:\Documentation\Musique\Marilyne\Scorpions%20-%20Still%20Loving%20You.gouv fifth and final test file:///D:\Documentation\Musique\Marilyne\Norah%20Jones%20-%20Wake%20Me%20Up.MP3

    BR

    guy038

  • Notepad++ not responding

    5
    0 Votes
    5 Posts
    16k Views
    Ashutosh SharmaA

    @mere-human Worked for me. Thanks

  • How to delete specific lines only with macro

    5
    0 Votes
    5 Posts
    188 Views
    Dominic LeblancD

    Thanks Guy, I really appreciate your help!

  • need to replace the pipe with / and remove the quotes in text

    6
    2 Votes
    6 Posts
    308 Views
    Thomas KnoefelT

    @Aj-Jarrard
    Or you can use MultiReplace Plugin to target specific columns and replace content only in these columns. … and you can even colorize your columns with that Plugin.

    2944b529-869d-4176-b624-e42423c475e4-image.png

  • DoxyIT on 64bit: Access violation

    5
    1 Votes
    5 Posts
    406 Views
    C

    @Clicketyclick Well I caved in and build myself a Python 2 script that does the job - for me at least. It’s available on my Github: clicketyclick.github.io/TipsAndTricks/Notepad++/Doxyit

  • Notes are getting deleted from Notepad++

    3
    0 Votes
    3 Posts
    279 Views
    EkopalypseE

    @Duty-Lead
    What version of Npp are you using?
    Can you post the debug information from the ? menu?

    Whatever i have written in notepad++, it is getting deleted after 4-5 days automatically

    What does that mean?
    The files are still there, but the contents have been removed? That would be very confusing!
    Or have the files disappeared? If so, which files are we talking about? Files that were backed up automatically?
    That is, that you did not save manually?
    I’m guessing you have software like CCleaner running that removes temporary stuff depending on the settings.

  • How do i unhide lines?

    15
    1 Votes
    15 Posts
    3k Views
    mkupperM

    @GrampaWildWilly The FAQ: Feature Request or Bug Report shows the best (and only) way to request and, or, to vote, on feature requests.

    On github I see six open issues when I search for “unhide” Unfortunately, most of the issues seem to be related to conflicts between hiding lines and other Notepad++ features.

    Maybe there’s an issue in there asking for just the ability to unhide a selection. I did not see it.

  • Help with find and replace

    4
    0 Votes
    4 Posts
    155 Views
    CoisesC

    @Terri-Willowkeep said in Help with find and replace:

    I doing something wrong?

    My guess is that you have Search Mode: Regular expression selected when you mean to have one of the other two options. A period in a regular expression matches any single character.

  • How to delete characters after certain number

    3
    0 Votes
    3 Posts
    129 Views
    Cristina MoiseC

    @Alan-Kilborn Can’t say in words how much I love you right now.You made my day !! So happy!Again thank you for your prompt answer.

  • Want to check spaces

    6
    0 Votes
    6 Posts
    636 Views
    Mampi BordoloiM

    @Mark-Olson Exactly what i mean. Thank you so much ❤️ for your help

  • Replace content between string that contains a specific word

    13
    0 Votes
    13 Posts
    555 Views
    Marius MasYM

    @PeterJones it is working good, thank you much

  • NPPExec: is it possible to detect if text is selected or not?

    3
    2 Votes
    3 Posts
    132 Views
    Mark OlsonM

    @pbarney

    If you want to detect if there is exactly one selection of nonzero length, do the following:

    Call SCI_GETSELECTIONS. If the result is greater than 1, there are multiple selections. Call SCI_GETSELECTIONSTART and SCI_GETSELECTIONEND to get the start and end of the selection. If the end is greater than the start, the user has a single nonzero-length selection. As you correctly identified, you can then use SCI_GETSELTEXT to get the selected text, although in this script it doesn’t look like that’s really necessary.

    Based on a recent issue I saw with the JSON-Viewer plugin where incorrectly assuming that the user always had a single selection caused NPP to crash, I think that validating that there is a single selection is generally good practice,

  • How to setup „Default Directory” for all users?

    2
    0 Votes
    2 Posts
    319 Views
    PeterJonesP

    @Bil-Dos ,

    There is no “override all users” option. If each user has their own login on the computer, and each are running Notepad++ with a “normal installation”, then %AppData%\Notepad++\config.xml (🛈: in this case, probably c:\users\<username>\AppData\Roaming\Notepad++\config.xml) will be separate for each user, and the only way to override that is to edit/overwrite each individual config.xml. In a normal installation, Notepad++ doesn’t have a “central” location for the settings that get stored in the config.xml.

    If you install somewhere other than Program Files and set it to use Local Config (“Don’t use %APPDATA%”), then all users’ config would come from the same config.xml in the installation directory – but that would mean they’d all share all the Settings > Preferences and other such settings in common, which might not be what you want.

    But there is no way to set it so that some settings come from a central location and some come from their individual files

  • Search/Replace to delete a line???

    3
    0 Votes
    3 Posts
    111 Views
    Alan KilbornA

    @o2-zen

    Find: \R
    Replace: with nothing
    Search mode: Regular expression

  • Move to New Instance grayed out.

    6
    0 Votes
    6 Posts
    5k Views
    Yuval GrimblatY

    Remember to save your file first. Once saved, you’ll be able to transfer it to a new instance. This operation isn’t possible with unsaved files.

  • Still stuck in Administrator mode

    18
    1 Votes
    18 Posts
    2k Views
    EkopalypseE

    For future readers: The tip mentioned by @JohnWren disables the User Account Control feature.
    I strongly recommend NOT doing this, it has a purpose.
    That’s like removing the airbag from your car to save weight so you use less fuel?

  • replace / character after speciffic word

    3
    0 Votes
    3 Posts
    731 Views
    Vio VioV

    @guy038 said in replace / character after speciffic word:

    /(?=[^/\r\n]+&type)

    Thank you very much.work as needed.
    no,i don’t think other then words/numbers in password are used. just to make sure added some and used second option,worked as needed to.
    Thank you again,this topic can be closed.

  • How can I make the context menus visible in Dark Mode?

    8
    0 Votes
    8 Posts
    381 Views
    AsylumETA

    @AsylumET I have managed to correct the issue however I am not entirely sure what actually caused it. I was using one of Windows high contrast themes for accessibility reasons. When I updated NP++ to the lastest version something must have gone wrong during the setup which resulted in the odd colored menus. I now believe that this was the case because I just went into my theme settings and switched to a normal windows theme and the context menu showed normally. I then switched back to the high contrast theme and it still shows normally.

    So if anyone has a similar issue, try switching windows themes if even only for a moment just to get things to update correctly.
    Screenshot 2024-09-21 201318.png

  • regex to remove part of a line with variable words

    9
    0 Votes
    9 Posts
    328 Views
    Rockberto ManentiR

    @Coises
    thanks for all the answers and suggestions, and sorry for my rudimentary English.
    the text files are all .cue files for music flacs, and the lines where the phrase (Artist name cover) can be is always composed like this:
    Title “song (artist name cover)”
    of course song and artist name are variable but the word cover followed by the brackets and " are always at the end of the line.
    Thanks for all the help… and I will try to read Literal Text Blocks when I finish editing the 3500 cue files!
    Many thanks