• Regex alternation in both FIND & REPLACE strings

    9
    1 Votes
    9 Posts
    807 Views
    M Andre Z EckenrodeM

    @guy038 said in Regex alternation in both FIND & REPLACE strings:

    Ok, so you could refer to this link to get the main punctuation characters :

    https://www.unicode.org/charts/PDF/U2000.pdf

    Thank. I’ll keep that in mind for if/when I ever need to use Unicode text on a large scale, though I’m not currently anticipating it will happen.

    This means that the part "\x20\x{2014}\x20, at the end, is rewritten whatever group matches the search regex.

    Ok, thanks for the detailed explanation and further suggestions as well. I will look for opportunities to apply them in future projects.

  • 0 Votes
    7 Posts
    2k Views
    guy038G

    Hi, @wagner-leung, @alan-kilborn and All,

    My bad ! So, if I interpret your intended result, strictly, the regex S/R becomes :

    SEARCH (?s)object((?!object).)+?type=2((?!object).)+?\K\babc(?=\h*=)

    REPLACE **aaa**

    Hope this version is the good one ! Of course, you may change the line type=2 and/or the variable abc as you like !

    Cheers,

    guy038

    P.S. :

    An other formulation of the search regex, using the free-spacing mode (?x) , would be :

    SEARCH (?xs) object ((?!object).)+? type=2 ((?!object).)+? \K\b abc (?=\h*=)

    For instance, the following search regex would search for the variable abc, in any object block containing, either, the line type=2 or type=3

    SEARCH (?xs) object ((?!object).)+? type=[23] ((?!object).)+? \K\b abc (?=\h*=)

  • Notepad ++ v7.9 does not download Dspell dictionaries.

    2
    0 Votes
    2 Posts
    287 Views
  • Add comma between two sentences on a two language document

    7
    0 Votes
    7 Posts
    372 Views
    guy038G

    Hi, @ali-jafari and All,

    Unfortunately, I cannot give you valuable information :-(( I’m presently using, on my old XP laptop, the Microsoft Office Suite2002, which is good enough for my Word’s work !

    SEARCH ( for Word ) : ([^0033-^0126])^0032*([^1536-^1791])

    REPLACE ( for Word ) : \1,\2

    In Word 2002, when your tick the search option Use generic characters, any non-Unicode char ( below \x0100 ), must be written as ^####, where #### represents the decimal value of the code-point. So, \x{0021} must be changed as ^0033, \x{007E} as ^0126 and so on…

    Unfortunately, syntaxes over \xFF, as for the main Arabic range [^1536-^1791], that is to say {\x{0600}-{06FF}] in N++ ), is definitively not a valid syntax :-((

    Moreover, the quantifier syntax {0,n}, after a possible space char, does not work, too. The {1,n}, only, seems valid ! So I prefered to use the usual * syntax

    Certainly, the recent versions of Word allows the search of characters of the BMP ( so from \x{0000} to \x{FFFF} ). If so, the proposed regex S/R should work correctly !

    On the other hand, why not process with the N++ regex engine, first and, then, paste your updated text in Word ?

    Cheers,

    guy038

  • Search for: and Replace with:

    13
    0 Votes
    13 Posts
    755 Views
    Olivier ThomasO

    Alan Kilborn wrote:
    If you ask a regexIf you ask a regex question here, and someone attempts to answer it (I will pay closer attention to who is asking in the future, and if it appears to be you I probably won’t answer), it will be answered from the perspective of Notepad++.
    So your goal won’t be achieved.

    PeterJones wrote:
    1.Your abuse of the forum doesn’t change the subject of the forum.

    2.If you create another new account sometime, I will call it out, so that other users will understand who it is that they are responding to, but other than that, I will go back to not replying to you, in any of your versions, because all that ever happens between us is arguing, and that doesn’t help anyone.

    I tried to explain everything, but … you don’t understand.
    And I realized that in the future I cannot count on your help.

    M Andre Z Eckenrode
    „(I hereby swear that the advice requested in this post is intended for use specifically in Notepad++.)”
    Are you not ashamed of it?

    However, I am tempted to write about this parable about „the gardener’s dog”.

    He himself won’t eat … but he won’t let anyone else either.

    You don’t have to write back, I don’t expect a reasonable answer.
    You can take 120 out of a 20-minute break.

    Greetings.

  • run python script to multiple opened files

    4
    0 Votes
    4 Posts
    930 Views
    Nick BrownN
    from Npp import * def forEachFile(func): for file in notepad.getFiles(): notepad.activateBufferID(file[1]) func() def printFilename(): print notepad.getCurrentFilename() # store the current buffer id currentBufferID = notepad.getCurrentBufferID() # run our printFilename function on each open file forEachFile(printFilename) # restore the current buffer from the stored buffer id. notepad.activateBufferID(currentBufferID)
  • 0 Votes
    5 Posts
    340 Views
    VijayPrabakarV

    ``Hi

    The requirement It is not very technical related to Java… I Just mentioned like that…

    My requirement is,
    Always the java file will have package line as below

    package com.abc.edf.*

    I want to copy this line from the list of all the java files and paste above package line only in new.txt file

    ``

  • The Nul Error

    11
    0 Votes
    11 Posts
    807 Views
    Alan KilbornA

    @PeterJones said in The Nul Error:

    and click on the “Bookmark 1 ♥” again

    Works, thanks!!

  • Can I see a preview for the result of the "replace" form?

    14
    0 Votes
    14 Posts
    630 Views
    pnedevP

    @Alan-Kilborn said in Can I see a preview for the result of the "replace" form?:

    Isn’t there another way for the plugin to do what it needs to without messing with the undo history?
    If you release your version of the plugin, maybe give it a slightly different name to prevent confusion.

    Unfortunately Compare plugin cannot circumvent the Undo history clean-up.

    The new plugin will be called ComparePlus, it has completely new alignment approach and keeps the Undo intact.
    It is almost finished but sadly that’s its state for about 8 months now. I’m not sure when exactly it will be ready.

    BR

  • Troubles building and executing NPP

    25
    1 Votes
    25 Posts
    2k Views
    andrecool-68A

    @ErwanDelhoveUCL

    It can be even easier to build a project if you run it from these three bat-files:

    Run as administrator x86 Native Tools Command Prompt for VS 2017

    call "full_file_path\x32_x64_START_BOOST.bat" Enter

    @echo on cd C:\sources\boost_1_70_0 call bootstrap.bat cd C:\sources\boost_1_70_0\libs\regex\build C:\sources\boost_1_70_0\b2.exe toolset=msvc link=static threading=multi runtime-link=static address-model=32 release stage C:\sources\boost_1_70_0\b2.exe toolset=msvc link=static threading=multi runtime-link=static address-model=64 release stage md C:\tmp\boostregexLib\x32 md C:\tmp\boostregexLib\x64 copy C:\sources\boost_1_70_0\stage\lib\libboost_regex-vc141-mt-s-x32-1_70.lib C:\tmp\boostregexLib\x32 copy C:\sources\boost_1_70_0\stage\lib\libboost_regex-vc141-mt-s-x64-1_70.lib C:\tmp\boostregexLib\x64 exit

    Run as administrator x86 Native Tools Command Prompt for VS 2017

    call "full_file_path\x32_START_SCINTILLA.bat" Enter

    @echo on cd C:\notepad-plus-plus-master\scintilla\win32\ nmake -f scintilla.mak clean nmake BOOSTPATH=C:\sources\boost_1_70_0\ BOOSTREGEXLIBPATH=C:\tmp\boostregexLib\x32\ -f scintilla.mak copy /y "C:\notepad-plus-plus-master\scintilla\bin\SciLexer.dll" "C:\notepad-plus-plus-master\PowerEditor\bin\SciLexer32.dll" exit

    Run as administrator x86_x64 Cross Tools Command Prompt for VS 2017

    call "full_file_path\x64_START_SCINTILLA.bat" Enter

    @echo on cd C:\notepad-plus-plus-master\scintilla\win32\ nmake -f scintilla.mak clean cd C:\notepad-plus-plus-master\scintilla\win32\ nmake BOOSTPATH=C:\sources\boost_1_70_0\ BOOSTREGEXLIBPATH=C:\tmp\boostregexLib\x64\ -f scintilla.mak copy /y "C:\notepad-plus-plus-master\scintilla\bin\SciLexer.dll" "C:\notepad-plus-plus-master\PowerEditor\bin\SciLexer64.dll" exit
  • Speeding up searches

    6
    0 Votes
    6 Posts
    2k Views
    PeterJonesP

    @gstavi , @Alan-Kilborn ,

    If only there were somewhere or other where an experienced Notepad++ & Other App user were able to post a tutorial on how to use those two things together. 😉

  • NP++ and hidden files

    3
    1 Votes
    3 Posts
    2k Views
    gstaviG

    Treating dot files as hidden is only a convention for shells and some other applications. There is nothing “hidden” about them as far as Linux file system or wine care. When I worked with NPP over wine I opened many dot files and files in dot directories without a problem.

    I wonder if it is a bug in the Explorer plugin where it treats dot files (and dot directories) as files with empty name and an extension which confuses it. This may explain the coloring issues. If you have a Windows system you can try creating a dot file there and check if it behaves differently than with wine.

    I am quite sure that if you just try to open the files from the ‘Open’ dialog you would not have a problem.

  • 0 Votes
    22 Posts
    2k Views
    Terry RT

    @W-den-Boer said in Find/remove duplicate multiple lines and keep the first occasions:

    But, bad news. It doesn’t do the same.

    Sorry to hear the macro failed to faithfully follow the steps I had outlined. At least with the steps you may be able to generate your own macro. I will suggest if doing so to select the very first position in the file between each major step using Ctrl-Home (I think thats the hotkey).

    Lately I’ve been seing what appears to be an anomaly where after a process has finished a word is highlighted. As this becomes a “selection” any subsequent process will likely ONLY work on that selection rather than the whole document.

    Terry

  • Translate regex to notepad++'s dialect and 'Reverse expression'

    11
    0 Votes
    11 Posts
    983 Views
    Alan KilbornA

    @litos81 said in Translate regex to notepad++'s dialect and 'Reverse expression':

    I have to click the ‘Replace All’ at least a couple of times because in some cases the expression seems to miss rules that should be excluded.

    if the expression was meant to be used with one click only I honestly don’t know how to fix it

    Sometimes, due to the nature of the data, this situation results.
    Also sometimes, the search/replace expressions can be rewritten to be a “one-click” solution, sometimes not.
    Often the complexity involved in such a rewrite is, well, extreme and “not worth it” – meaning not putting the time required to figure it out into it.

    But, just in case you thought it was some kind of “bug”…it’s not.

  • Tabs always open on the right?

    29
    0 Votes
    29 Posts
    4k Views
    appyfaceA

    Ah, you may be on to something. Thankfully, nothing is lost, it just didn’t open them. I’ll see what I can hunt up.

  • HTML shows as code in browser

    3
    0 Votes
    3 Posts
    217 Views
    AstralJokerA

    yep, I just figured out it had no termination , it was just a file. Thank you for the response tho !

  • only replace exact numbers

    14
    0 Votes
    14 Posts
    1k Views
    Alan KilbornA

    @Olivier-Thomas said in only replace exact numbers:

    In the IVONA voice-over for film subtitles
    I have over 6000 abbreviated commands.
    I did not notice that the IVONA lector did not keep up with reading the text.

    I’m not sure what this means.
    Do you care to explain a bit, if it is relevant?
    After 20 minutes, of course… :-)

  • Where are the display settings stored?

    3
    0 Votes
    3 Posts
    974 Views
    Alan KilbornA

    @PeterJones said in Where are the display settings stored?:

    {🛈 , ↗}

    Oooooh, nice!

  • Prevent sending dump report when NP++ crashes?

    2
    0 Votes
    2 Posts
    136 Views
    PeterJonesP

    @Claudia-Svenson ,

    Is this true?

    Not as far as I know.

  • Notepad++ and Mod360

    8
    0 Votes
    8 Posts
    391 Views
    Lorenzo AtomL

    @Alan-Kilborn
    I really do nothing because is true… i am able to speak 3 languages, but is true i use noteapd++ for something very very simple… i do not know anything about programming scripting or something else…
    Should be the same if i ask you to write down a poem in italian… from scratch… i think you got the point.