• How to insert text at the end of every url?

    3
    0 Votes
    3 Posts
    831 Views
    PeterJonesP

    @Rob-K ,

    I just said:

    FIND = (?i-s)^\h*https?://test.domain\S* REPLACE = $0 new stuff

    The FIND would be better as:

    FIND = (?i-s)^\h*https?://test\.domain\S*

    Quick explanation of the regex:

    the stuff in parentheses set up options to make it case insensitive and to not let . match newline

    ^ means the match starts at the beginning of the line

    \h* allows 0 or more horizontal spaces (tabs and space characters) before the url

    https?:// allows either http or https

    \. escapes the ., so it means a literal domain separator, not the regex wildcard character

    \S* means that there can be 0 or more additional non-space characters after the domain; since the end-of-line sequence counts as space character, it will stop at the end of the line if there’s nothing after the URL

    $0 in the REPLACE means the entire matched text – so everything from beginning of line to just before the first space (or end-of-line).

    new stuff indicates the new text you want to add

    This means that the replacement will still include the original URL, plus the new stuff.

  • Synchonize by line

    2
    0 Votes
    2 Posts
    126 Views
    EkopalypseE

    @Laurent-Cnoname

    Not as far as I know. You could of course turn off the word wrapping
    but you probably have that on to avoid horizontal scrolling, haven’t you?

  • I would like to find lines where there are 2x double spaces

    18
    0 Votes
    18 Posts
    2k Views
    Thomas 2020T

    this is it:
    Schowek02.jpg

  • File text replaced with "NuL", how do i see/recover it?

    6
    0 Votes
    6 Posts
    1k Views
    sgtsixpackS

    I just created a list of files using defraggler and npp showed the same behavior. When I tried to open it in microsoft notepad although it took a lot longer the data was intact. I know its a bit late but if have u tried notepad to read your “important” codes?

  • golang..

    2
    0 Votes
    2 Posts
    147 Views
    EkopalypseE

    @JACKCHEN213

    There is an udl for golang here.

  • 0 Votes
    2 Posts
    164 Views
    EkopalypseE

    @Mark-Tinney-0 said in Python runs differently in NPP Exec Console vs Windows Console.:

    prefix = ’ ’
    body = ‘┌──────────────────────────────────────────────────────────────┐’
    suffix = ’ ’

    print(prefix+body+suffix)

    Is this something you have under your control?
    If so, you could create a unique environment variable and check this from your script.
    Something like this.

    In NppExec execute you do

    NPP_SAVE $(FULL_CURRENT_PATH) set_env CALLED_FROM_NPP_EXEC=1 D:\ProgramData\Python\Python_embed_382_64\python.exe "$(FULL_CURRENT_PATH)" env_unset CALLED_FROM_NPP_EXEC

    and in python script you do

    import os print(f'{"CALLED_FROM_NPP_EXEC" in os.environ = }')
  • 0 Votes
    9 Posts
    1k Views
    mkupperM

    Thank you @Ekopalypse for the explanation of styles vs. indicators. After a few days of using npp with the python script modified indicators I’m quite happy with the results.

  • Using RegEx in Notepad++ to delete all lines contain certain keywords?

    3
    0 Votes
    3 Posts
    505 Views
    Terry RT

    @Terry-R said in Using RegEx in Notepad++ to delete all lines contain certain keywords?:

    if the word cat or fish is part of a larger word it will still be removed

    A slightly revised regex would be
    Find What:^(.+)?(\bcat\b|\bfish\b)(.+)?\R?

    This expects non word characters (boundaries) to exist around the words cat and fish, thus cat-2 is still caught.

    Terry

  • RegEx... Exchange

    7
    0 Votes
    7 Posts
    219 Views
    astrosofistaA

    @Pan-Jan said in RegEx... Exchange:

    I don’t have a \R

    Try \v for vertical whitespace. Perhaps it works in that editor.

  • 0 Votes
    4 Posts
    254 Views
    Batuhan HınçalB

    @PeterJones it worked, you’re a big man with big heart you saved me precious hours of my time

    I wish a lot of people help you in your life, god bless you.

  • Default save as option

    4
    0 Votes
    4 Posts
    803 Views
    EkopalypseE

    @Makwana-Prahlad,

    current versions, like 7.8.9, append an extension to the name if possible.

  • Inserting g code using replace

    5
    0 Votes
    5 Posts
    763 Views
    guy038G

    Hi, @crafty-crafty, @ekopalypse, and All,

    From the @ekopalypse macro solution, here is an similar solution which can be generalized to :

    Any number of lines which are to be replaced, in the limit of 2,048 characters

    Any number of lines which are to be inserted, during the replacement

    But, first, let’s suppose that you simply have a specific line, repeated many times in your file, which must be replaced with a specific block of lines. Assuming that this line is named #Line# :

    Open a new tab ( Ctrl+ N )

    Type in the specific line #Line# line, followed with a line-break

    Select the entire line #Line#, with its line-break

    Open the Find dialog ( CTRL + F )

    Select, if necessary, the Normal search mode

    Leave all the other options unchecked

    Click on the Find Next button ( Of course, no other occurrence is found, but it does not matter ! )

    Close the Find dialog ( Esc )

    Run the option Macro > Start Recording

    Hit the F3 key ( Whatever an occurrence is found, or not, does not matter ! )

    Hit the Ctrl + V shortcut ( The present contents of clipboard do not matter, too ! )

    Run the option Macro > Stop Recording

    Then, run the option Macro > Save Currently Recorded Macro...

    Type in Replace Next Occurrence with Clipboard Contents, in the Name zone

    Preferably, create a shortcut for this macro

    Click on the OK button to valid the dialog

    Create or select the block of lines, in any file, which must replace the #Line# line

    Copy this block of lines in the clipboard ( Ctrl + C )

    Now, open or select your specific file

    If necessary, move to the very beginning of file ( Ctrl + Home )

    Run the option Macro > Run a Macro Multiple Times...

    Select the Replace Next Occurrence with Clipboard Contents macro

    Tick the Run until the end of file option

    Click on the Run button

    Voila ;-))

    Remark :

    After finding all the occurrences of the specific line, a last search operation is carried on, without success. So, the last #Line# line is replaced by two or more consecutive contents of the clipboard. Thus, a last task has to be done :

    Delete the few extra blocks of text that have been wrongly inserted, after the last match !

    As said above, this macro is not specific and can be used to insert any contents of the clipboard, in replacement of any specific text, even split on several lines, as long as the total amount of text is smaller than 2,048 characters ( Max size of the Find what: zone )

    So, now that the macro Replace Next Occurrence with Clipboard Contents has been created, the road map becomes :

    Create and select the text range which is to be replaced

    Open the Find dialog ( CTRL + F )

    Select, if necessary, the Normal search mode

    Leave all the other options unchecked

    Click on the Find Next button ( Whatever an occurrence of the range is found or not does not matter ! )

    Close the Find dialog ( Esc )

    Create and select the text range, in any file, even split on several lines, which will replace the initial range

    Copy this text range in the clipboard ( Ctrl + C )

    Now, open or select the specific file, where the replacements must occur

    If necessary, move to the very beginning of the file ( Ctrl + Home )

    Run the option Macro > Run a Macro Multiple Times...

    Select the Replace Next Occurrence with Clipboard Contents macro

    Tick the Run until the end of file option

    Click on the Run button

    Finally, delete the few extra range of text that have been wrongly inserted, after the last matched range !

    Best Regards

    guy038

  • How to insert text into the second line with RegEx in Notepad ++ ?

    21
    0 Votes
    21 Posts
    5k Views
    Thomas 2020T

    Schowek01.jpg

  • Add the Icon to the toolbar

    32
    0 Votes
    32 Posts
    8k Views
    Thomas 2020T

    Here some even write in Italian.

    The problem is to explain what problem I have with Notepad.
    Even the English don’t always understand each other.
    How I am trying to explain in short sentences
    some write that I am rude or arrogant.

    Today I figured out how to use
    Google translator.
    Dzisiaj wpadłem na pomysł jak używać Google translatora,
    aby tłumaczenie było jak najlepsze.

  • Problem with converting lowercase to uppercase

    12
    0 Votes
    12 Posts
    689 Views
    Thomas 2020T

    @mkupper said in Problem with converting lowercase to uppercase:

    as there are people who have Mc… style surnames where the third character is not upper-case

    e.g?

  • How do I sort words differently?

    7
    0 Votes
    7 Posts
    258 Views
    Thomas 2020T

    Briefly and succinctly.

    Schowek01.jpg
    there are over 1000 words

  • LaTeX delimiters

    2
    0 Votes
    2 Posts
    181 Views
    EkopalypseE

    If you are talking about the LaTeX lexer from Scintilla, it makes sense to make the request there,
    but if you are using a UDL, then we need more information about what exactly you do.

  • 7.8.8 problems with open files (on a network drive)

    3
    0 Votes
    3 Posts
    210 Views
    tseGITT

    just tested new 7.8.9 32bit --> same problem.
    But my special one can be solved. Instead of using .LOG als “SQL” i assigned “LOG” to VB / VB5 in stylers.xml. Now syntax highlighting is OK and the freeze is gone.

  • .bat file auto path updater

    4
    0 Votes
    4 Posts
    759 Views
    Michael VincentM

    @Alexander-Brkljac

    set file=%~dp0\OUTPUT.txt

    Cheers.

  • 0 Votes
    8 Posts
    300 Views
    astrosofistaA

    @Ekopalypse said in possibile creare una regola dal momento in cui si riceve file txt senza aprire il file?:

    wasn’t intended.

    OK, good to know that :)

    Just trying to be helpfull beyond service

    Which you do very well. Keep up the good work. :-)

    Sure, I always try to do my best, and as I understand, you do as well!

    Take care.