• Regex - \K pattern alternatives

    5
    0 Votes
    5 Posts
    2k Views
    guy038G

    Hi @vasile-caraus, @peterjones, @alan-kilborn and All,

    First, Alan I apologize because I forgot a part of a sentence, in my previous post ! I said :

    It is said that .NET supports full regular expression syntax. So, you do not need the use of the \K feature ;-))

    But I wanted to say :

    It is said that .NET supports full regular expression syntax within look-behinds. So, you do not need the use of the \K feature ;-))

    Indeed, using the examples of special look-behind constructions, given in :

    https://www.regular-expressions.info/refadv.html

    (?<=is|e)t matches the second and fourth letter t in the string twisty streets. This syntax should work with .NET and does not work with our Boost regex engine. Whereas the similar syntax (?<=is|ee)t, with alternatives of the same length, is correct with Boost !

    (?<=s\w{1,7})t matches only the fourth letter t in the string twisty streets. This syntax should work with .NET and does not work with our Boost regex engine. Whereas the similar syntax (?<=s\w{4})t, , with a fix number of repetitions, is correct with Boost !

    (?<=s\w+)t matches only the fourth letter t in the string twisty streets. This syntax should work with .NET and does not work with our Boost regex engine. Whereas the syntax s\w+\Kt, using the \K feature, is correct with Boost !

    (\w).+(?<=\1), with a back-reference inside the look-behind, matches twisty street in the string twisty streets. This syntax should work with .NET and does not work with our Boost regex engine. Whereas the syntax (\w).+\1, without any look-behind feature, is, of course, correct with Boost !. In the both cases, assuming the implicit (?-s) modifier, it matches the longest zone of standard characters between a same starting and ending word character ! However, note a subtle difference :

    With the .NET syntax, (\w).+(?<=\1), the .+ part matches the string wisty street

    With the Boost syntax, (\w).+\1, the .+ part matches the string wisty stree

    s\Kt, with the \K feature ( “Keep text out of the regex match” ), matches the second and third letter t in the string twisty streets. Seemingly, this syntax is not allowed in .NET regex engine but does work with our Boost regex engine ! Note that this example is trivial because we can use, instead, both with .NET and Boost, the regex (?<=s)t, which uses a simple look-behind structure ;-))

    I hope, Alan, that these additional explanations will shed some light on this matter ;-))

    Best Regards,

    guy038

  • Control symbols now inserted on macro

    27
    0 Votes
    27 Posts
    3k Views
    PeterJonesP

    @Alan-Kilborn said in Control symbols now inserted on macro:

    recordedMacroStep::PlayBack
    … ansiBuffer[4];

    That makes some sense. At first I was wondering what change prompted that to start failing, and the GitHub blame shows those two lines haven’t been changed in 3-4 years. But really, if Scintilla changed the way it’s doing things, maybe the _sParameter.c_str() now has a 4byte char rather than a 3byte char, or something.

    Alternately, MS Docs: WideCharToMultiByte shows that sending cbMultiByte (the 3 or 4 in the last arg before the NULLs) as a 0 will have it return the width needed, so wouldn’t it be more future proof to use:

    int ansiBufferLength = ::WideCharToMultiByte(static_cast<UINT>(pEditView->execute(SCI_GETCODEPAGE)), 0, _sParameter.c_str(), -1, ansiBuffer, 0, NULL, NULL); // grab needed ansiBuffer length ::WideCharToMultiByte(static_cast<UINT>(pEditView->execute(SCI_GETCODEPAGE)), 0, _sParameter.c_str(), -1, ansiBuffer, ansiBufferLength, NULL, NULL);

    (though you’d need to either re-dim ansiBuffer, or make sure it’s always got enough room)

  • Difficulty Selecting Text

    7
    0 Votes
    7 Posts
    1k Views
    EkopalypseE

    @Alan-Kilborn

    Yes, I think this is a mouse pointing thing which, btw., SciTe does as well.
    Not sure how easy it would be for npp to handle this differently and
    yes, I never noticed this as well. :-)

  • 0 Votes
    2 Posts
    328 Views
    andrecool-68A

    @magy-abbas
    Looks like you’re making a fake site ?!

  • Horizontal two finger swipe to move the cursor? (TouchPad)

    3
    0 Votes
    3 Posts
    393 Views
    Hyung-jun ChangH

    @Ekopalypse No I am using generic HP notebook with a built-in ‘precision touchpad.’ And I’m afraid I don’t know if any other Win10 apps have this function. I was just using an iPad and thought it would be cool to have this kind of function in Notepad++ since you know, iPad’s touchscreen and the notebook’s Touchpad works in a very similar way.

  • Where to find help?

    2
    0 Votes
    2 Posts
    178 Views
    EkopalypseE

    @Andreas-Krüger

    sources for the onine documentation is available via github repo.

  • How do I improve the go to next bookmark option?

    7
    0 Votes
    7 Posts
    511 Views
    andrecool-68A

    @Alan-Kilborn
    After moving to the next bookmark, you need to click on the down arrow, and then everything turns out as I need.
    It’s a pity that it’s not possible to write all this into a macro, the macro does not see the operation with the plugin))

  • How to reduce number to keystrokes for finding and replacing word?

    4
    0 Votes
    4 Posts
    342 Views
    EkopalypseE

    @Alan-Kilborn said in How to reduce number to keystrokes for finding and replacing word?:

    not sure why Eko pointed you to “Using Modify Shortcut/Delete Command from Run menu

    Same window, different tab - came first to my mind.
    No special intention. :-)

  • Highlight line when // is used

    2
    0 Votes
    2 Posts
    214 Views
    EkopalypseE

    @Jonathan-Russell

    what can be styled or not is defined by the lexer, which means you
    cannot add some random tokens to an existing lexer configuration.
    In order to be able to treat your forwardslashes you must either

    write your own lexer write your own user defined language (menu language->define your language…) or use a scripting language like PythonScript to tweak the builtin lexers or UDLs.

    Each of them have their pro and cons and which one fits your requirements depends on your knowledge about programming
    and the will for implementation.

  • Searching for a specific string

    3
    0 Votes
    3 Posts
    216 Views
    Klemen MočnikK

    Works like a charm… :)

    Thanks a lot!

  • Why Clipboard gets deactivated?

    3
    0 Votes
    3 Posts
    295 Views
    Michael VincentM

    @Michael-Vincent
    N++ does have a clipboard history feature built in and I wonder if that was conflicting with X-ming hook into the clipboard which enabled clipboard sharing between regular windows and x-sever applications.

    I’m using Ditto now on recommendation from @dinkumoil with no I’ll affects.

    Cheers.

  • How I find two strings and concatenate them?

    3
    0 Votes
    3 Posts
    289 Views
    Alan KilbornA

    @Henrique-Sato

    Why doesn’t your very first line get modified in your “I need” section?

  • Unable to use Notepad++ to find & replace umlauts (and others)

    3
    0 Votes
    3 Posts
    406 Views
    dinkumoilD

    @DandyDonnyDon

    Since your “Here’s the XML source code” and your “here’s what I need” are identical, it is totally unclear what you want to achieve.

    Maybe this was caused by interpreting and re-formating your posting by the forum software. To avoid this the forum supports Markdown in postings. With its help it is possible to post code in a way the forum doesn’t interpret and re-format.

    You can find a code formatting button in the toolbar above the input box for postings. >>> This page <<< provides a deeper insight of the markdown syntax used by this forum.

  • Search and replace text lines at same time possible?

    3
    0 Votes
    3 Posts
    231 Views
    dinkumoilD

    @Melanie-Niedfeld

    It is possible by activating extended search mode and using escape sequences for line breaks (CrLf):

    1c9191f5-66bc-4387-8ee1-1c2bd2c68038-grafik.png

  • 2 Votes
    5 Posts
    696 Views
    dinkumoilD

    @Евгений-М said in Notepad++ project under attack, postings may have to undergo moderation before being publicly visible:

    When will my question be moderated?

    It already is, see >>> here <<<.

  • 0 Votes
    4 Posts
    1k Views
    Linda HullL

    @PeterJones Thank you! You understood me. Turning off the auto-completion, did it :)
    Regards the ‘blinking’: Every word and letter I typed caused the popup to come up or changed it. I like things to hold still, on my screen.

    Linda

  • UDL Keyword Match

    2
    0 Votes
    2 Posts
    216 Views
    dinkumoilD

    Because the requirement of moderation of postings created by new members is still activated, this posting was lost in the Post Queue for 2 days. This comment is only for bumping it up in the list of recent postings.

  • Press return on keyboard; only get CR no LF in text

    2
    0 Votes
    2 Posts
    189 Views
    dinkumoilD

    Because the requirement of moderation of postings created by new members is still activated, this posting was lost in the Post Queue for 2 days. This comment is only for bumping it up in the list of recent postings.

  • Serch for "numbers"?

    11
    0 Votes
    11 Posts
    484 Views
    Alan KilbornA

    What the heck!

  • How do I change how notepad++ handles opening and storing files?

    2
    0 Votes
    2 Posts
    419 Views
    dinkumoilD

    @throw-away said in How do I change how notepad++ handles opening and storing files?:

    So how do I make notepad++ behave just like normal notepad? … I do not want notepad++ to keep my files open or remember my files when I close them.

    Turn off the session feature:

    4d6b0c55-04dd-4962-a626-3000596fcc0d-grafik.png

    How do I tell notepad to always open all files with a specific language?

    In Style Configurator you can add to every lexer user defined file name extensions which should be opened with that lexer:

    df710812-6638-472a-b5e3-76cc811d7877-grafik.png