• [SOLVED] Selected lines do not get indented with TAB for me

    1
    2 Votes
    1 Posts
    178 Views
    No one has replied
  • Languages: Formatting rest of line after keyword

    4
    0 Votes
    4 Posts
    333 Views
    PigankleP

    @PeterJones That’s very helpful - thank you!

  • Selecting things of a certain type

    3
    0 Votes
    3 Posts
    7k Views
    Mark OlsonM

    Find/replace (?-si)(?::\s*"|(?<!%)%\d*[dsf]|(?!\A)\G)\K((?:(?!(?:(?<!%)%\d*[dsf]|")).)*) with \U\1\E.

    Note that this won’t actually convert all your text to upper-case, because some of it (the %s format specifiers) will probably cause bugs downstream if it is capitalized. This regex is very careful to avoid capitalizing format specifiers, which is a lot of why it looks (and is, TBH) so hairy.

    My regex doesn’t handle all the possible syntax surrounding format specifiers, because I don’t have 3 hours to spend enumerating and debugging each weird edge case, but it should be fine assuming that all the strings are values in dictionaries. The find-regex becomes the absolutely abhorrent (?-si)(?:"|(?<!%)%\d*[dsf]|(?!\A)\G)\K(?=[^"]*"\s*[,\]\}])((?:(?!(?:(?<!%)%\d*[dsf]|")).)*) in the case where the strings can be strings in arrays or values in dictionaries.

    Test text:

    { "a.b": "caps %02d %5s %d %03fnocaps %%02dcaps", "b.c.d": "%%caps %3sap %s cap" }

    Expected output:

    { "a.b": "CAPS %02d %5s %d %03fNOCAPS %%02DCAPS", "B.C.D": "%%CAPS %3sAP %s CAP" }

    If you’re absolutely sure you want to capitalize everything that’s not a key, just use this much simpler regex-replace: "\s*:\s*"[^"]*"

  • Help with finding prefixes & selecting entire string

    3
    0 Votes
    3 Posts
    327 Views
    Pool StripP

    Terry-R said in Help with finding prefixes & selecting entire string:

    @Miska-Virtanen said in Help with finding prefixes & selecting entire string:

    If I wanted to find all the strings starting with “bb_”, and highlight & replace the entire string, up until the next comma.

    That can be done simply with a regular expression (regex). Using the Replace function you would have
    Find What:\bbb_[^,]+
    Replace With:ZZZ
    Search mode must be set to regular expression.

    It didn’t sound as if it was only at the start of a line, hence my regex will look for that sequence in any “cell”. If this isn’t what you actually wanted you will need to elaborate.

    Terry

    Thanks.

  • Find duplicate variable declaration Regex

    5
    0 Votes
    5 Posts
    605 Views
    Stuart DyerS

    Thanks @Mark-Olson / @guy038

    Both solutions work a treat !

    Appreciate the fast turn around

  • Find specific character in a specific word

    2
    0 Votes
    2 Posts
    219 Views
    Lycan ThropeL

    @Anxo-Alvarez ,

    Why?
    I feel there’s a, “well now I want to do this, and also this” coming, so why don’t you just layout the full issue you’re thinking of doing, and let’s go from there, but in the meantime, check out the FAQ section in the Forums, particularly:

    FAQ Desk: Formatting Forum Posts
    FAQ Desk: Generic Regular Expression (regex) Formulas
    FAQ Desk: Where to find REGular EXpressions (RegEx) documentation ?

  • Macro's stopped working

    3
    0 Votes
    3 Posts
    453 Views
    wonkawillyW

    With the new version of Npp 853 the macro system has been updated: now supports Unicode chars too. So it is needed to update your macro to these new standards to make them work again. The FAQ section indicated by the previous poster will help you to do that.

  • Find Replace <filename000> with <filename001>

    9
    0 Votes
    9 Posts
    418 Views
    guy038G

    Hello, @reddreddyredd, @mark-olson, @terry-r, @lycan-thrope, @coises and All,

    @reddreddyredd, I know that you already reached your goal, with all the advices given in the previous posts, but here is an alternate method :

    Move the caret at the beginning of your first string fire_smoke_multi000

    Automatically, place any instance of fire_smoke_multi000 at the very beginning of lines with the following regex S/R :

    SEARCH \R(?!fire_smoke_multi000)

    REPLACE #

    Do a 120 × 3 rectangular selection of the string 000

    Open the **Column Editor ( ALT + C ) and replace this selection with the appropriate numbering

    Finally, replace any # character with a line-break, with the regex S/R :

    SEARCH #

    REPLACE \r\n    OR    \n ( for an UNIX file )

    Best Regards,

    guy038

  • fix html code with regex

    2
    0 Votes
    2 Posts
    289 Views
    PeterJonesP

    @Giannis-Katebakis ,

    FAQ
    => Generic Regular Expression (regex) Formulas
    => Replacing in a specific zone of text

    The “zone” you want starts with <p (BSR) and ends with </p> (ESR). You want to find newlines using FR=\R in that zone, and replace with a space character as the RR .

    Actually, since your lines are also indented, then FR should probably be \s+ – which would collapse one or more whitespace inside the tags (whether spaces or tabs or newlines or unicode whitespace) into a single space each).

    When I replace each of the bolded BSR/ESR/FR/RR with the values I listed, and did a Replace All, it converted

    <p align="justify" >The captain and the crew were taking care of the last details when someone remembered that there was no ice in the boat, nor the necessary amount of beer. A volunteer was found and he rushed to buy all that was needed. Soon he was back with a big bag full of ice and a dozen beers and other refreshments.</p> <p align="justify" >The captain decided that everything was ready and we should board the boat and sail. Five minutes later we watched the little harbour getting smaller and smaller. The trip to Ayiofarango had just started.</p>

    to

    <p align="justify" >The captain and the crew were taking care of the last details when someone remembered that there was no ice in the boat, nor the necessary amount of beer. A volunteer was found and he rushed to buy all that was needed. Soon he was back with a big bag full of ice and a dozen beers and other refreshments.</p> <p align="justify" >The captain decided that everything was ready and we should board the boat and sail. Five minutes later we watched the little harbour getting smaller and smaller. The trip to Ayiofarango had just started.</p>
  • sort failure

    3
    0 Votes
    3 Posts
    202 Views
    mkupperM

    @Bernard I’m guessing there is an invisible character at the start of the 4th to last lines that is causing them to be sorted after the first three lines.

    Try clicking on the blue pilcrow (¶) for Show All Characters in the toolbar to see if things such as ZWSP, ZWNJ, or ZWJ show up. They will have a white letters with a black background.

    Another guess is that the file you are editing is marked as read-only. The sort function will do nothing on read-only files. If you right click on the tab for that file see if there is a checkmark to the left of the word “read only” in the right click menu. If so, select that menu option and it’ll turn the read-only mode off.

  • Regression of v8.5.0, still found in v8.5.3 tracking write protection

    3
    0 Votes
    3 Posts
    170 Views
    Alan KilbornA

    @csystems-hv said in Regression of v8.5.0, still found in v8.5.3 tracking write protection:

    sorry for posting here.

    No worries. It is often good to post here first anyway; there may be a simple fix to your problem that the user community can point you to.

  • How do I change font?

    13
    0 Votes
    13 Posts
    124k Views
    Mekki CharfiM

    @Meta-Chuh Thank you very much for your help !

  • 0 Votes
    3 Posts
    1k Views
    Mark OlsonM

    You’re both more likely to get help if you go to the GitHub repo.

  • Regex: Delete empty lines inside an html tag, after .dot

    8
    0 Votes
    8 Posts
    445 Views
    Rufi MaR

    @Mark-Olson said in Regex: Delete empty lines inside an html tag, after .dot:

    @Neculai-I-Fantanaru
    Yes, my regex did that. If you looked at my data, you would see that your initial example was part of it and my regex did that.

    I’m glad you found a solution that works. However, I would note that the \s+\s+ in your regex should be replaced with \s+ because the second \s+ contributes nothing.

    Thanks it helps a lot.

  • help to delete some blank lines

    4
    0 Votes
    4 Posts
    200 Views
    guy038G

    Hi, @namx3249 and All,

    Ah…, I simply added a leading TAB char before each line of the first part to show you that the regex S/R could also handle this case !

    But, If you’re sure that leading blank chars won’t appear in your file, you can simplify the regex S/R as below, to get a similar OUTPUT :

    SEARCH (?-s)^(.+\R)\R+(?=http)

    REPLACE \1

    BR

    guy038

  • Custom Language numbers only working in some places

    7
    0 Votes
    7 Posts
    298 Views
    Victor NonyaV

    @PeterJones Yes but the example you showed all the na’s were the same color. In your example all three of the na’s in different locations were all orange.

    I’m trying to set the na function to another color and all the other na’s be orange.

    in your example you have the function as orange. I need it to be blue but I still need the na, na, na, and the = na to be orange.

    the result I’m looking for would look like this.

    Screenshot 2023-06-03 133744.png

    It may also be a limitation like with the numbers that I’ll just have to live with it being the same color which is fine if that’s the case it doesn’t have to be identical to the tradingview editor.

    I’ve added na in two locations in the keywords section. One in the main keywords that stores all the functions which are blue. Then I’ve added it again in another keyword section that is pinkish color and using the () delimiter it works great as long as the na’s are inside the () but the ones outside are blue so it’s probably just a limitation that I’ll have to live with since the na’s that are functions are also outside of the ().

    as far as the numbers issue I can always change the way I am coding and stop using numbers in the variables and type them out like one, two, three if that truly bothers me. it’s not really a big issue. It is super cool the stuff you can do with notepad++ I do enjoy learning this stuff.

    EDIT: after removing the () delimiter that I was only using for the na that fixed the issue with the numbers not working. All the numbers show up as they should now. I’ll just live with all the na’s being one color it’s not too big of an issue for me.

  • button in notepad

    2
    0 Votes
    2 Posts
    633 Views
    PeterJonesP

    @Miguel-Tiezi ,

    There’s already a “New File” button on the toolbar. And there’s a Customize Toolbar plugin, which allows you to add other Notepad++ features to the toolbar even if they aren’t there naturally. And if you are coding a plugin from scratch, you can add buttons to the toolbar. If none of those cover what you want, then you will have to be more specific.

  • Issue setting text color for quotes in XML style

    3
    0 Votes
    3 Posts
    280 Views
    EkopalypseE

    @Victor-Nonya

    Instead of editing the XML file directly, use the dialog “Language->User defined language->Define your language …”.
    and define a delimiter using " as open and close tag.

    18213ace-4066-46b6-9a8b-a53e2cf5e882-image.png

  • Stylers.xml / lang.xml

    3
    0 Votes
    3 Posts
    194 Views
    Bernd OldenbeuvingB

    Hi Peter,

    thx for your reply! I already tried some of the tricks you provided, but I overlooked one that I will try this weekend.
    Will post the result

    Regards Bernd

  • Background color of text in dark mode

    4
    0 Votes
    4 Posts
    567 Views
    Alan KilbornA

    @Nikhil-Gupta said in Background color of text in dark mode:

    the background color has changed to greenish/greyish tinge

    Hope Notepad++ team reverts it back to black in their next version

    AFAICT, there’s nothing to revert, looking at defaults in 8.5.3. Dark mode background color has never been an absolute black, as far as I know.