• Help with semi-complicated regex / Notepad++ regex issue

    9
    1 Votes
    9 Posts
    29k Views
    guy038G

    Hi DaveyD and All,

    Ah, Yes ! I can apply the Dail’s \K syntax to my previous regex. So, finally, here are my two solutions :

    Find what : (?<!\|)\t(.+)(\R[|\t-]+) which works with, either, the Replace All or the Replace button

    OR

    Find what : [^|]\t\K(.+)(\R[|\t-]+), which ONLY works with the Replace All button

    For these two search regexes, the replacement regex is :

    Replace with : $2$1$2

    I don’t think that we can shorten them, anymore !

    Notes :

    When your search regex contains a \K form, the step by step replacement never works !! That’s the normal behaviour !

    There are two cases, where the \K feature is mandatory and can NOT be replaced with lookbehinds :

    When the regex, inside the lookbehind, could match non-fixed length strings, as, for instance, the regex (?<=\d+)abc

    When the regex, inside the lookbehind contains alternatives, of different length, as, for instance, the regex (?<=(12|345|6789))abc

    So, in order to get valid regular expressions, you must change them, respectively, into the two, below, which include, both, the \K syntax :

    \d+\Kabc

    (12|345|6789)\Kabc

    On the contrary, for instance, the two regexes (?<=\d{3})abc and ((?<=(00|99))abc are quite valid ones. Indeed, inside the lookbehind, the former refers to a three-digits number, only and, in the later, each alternative refers to a same two-digits number :-)

    You may test these 4 regexes against this short example text, below :

    00abc 12abc 345abc 6789abc 99abc

    Cheers,

    guy038

  • Plugin problems: can't enable/disable plugins

    4
    0 Votes
    4 Posts
    9k Views
    Jon JJ

    And I think I found a bug with the Customize Toolbar plugin. When that plugin is enabled, I start having the same error again, with the checkboxes disappearing from the other plugin settings (like in my first post above). But when I disable the plugin, then the checkboxes start working again.

  • When save a new HTML it doesent link to internet

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Notepad++ 6.9.2 dont start after Upgrade to WIN 10

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • letters instead of numbers

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Remapping hotkey for incremental search

    Locked
    4
  • Background-image doesn't work

    Locked
    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • which design ist that?

    Locked
    4
    0 Votes
    4 Posts
    27k Views
    maxistinktM

    thanks !!!

  • Freezing while i cut/paste

    Locked
    2
    0 Votes
    2 Posts
    13k Views
    Stefano VenneriS

    Found the problem…
    It was the Clipboard History … just disabled!

  • Strange font in tabs

    Locked
    1
    0 Votes
    1 Posts
    6k Views
    No one has replied
  • R Syntax highlighting for dark themes

    4
    0 Votes
    4 Posts
    34k Views
    dailD

    You are able to add this in on your own. Take a look at this section of the default theme. If you copy and paste this into another theme (for example Monokai.xml) which does not have a LexerType for R yet, you will then be able to highlight R with that style. However this will still have the color/style of whatever the default theme is using which won’t match Monokai. So you can either edit the pasted XML manually to get appropriate colors, or once you paste that into the xml file and start Notepad++ you will be able to edit the style for R using the Style Configurator.

  • Find extended characters

    2
    0 Votes
    2 Posts
    22k Views
  • Save All icon not updating properly

    Locked
    1
    0 Votes
    1 Posts
    6k Views
    No one has replied
  • HTML tag plugin

    Locked
    1
    0 Votes
    1 Posts
    6k Views
    No one has replied
  • 2 navbars using html and CSS

    Locked
    1
    0 Votes
    1 Posts
    9k Views
    No one has replied
  • Cannot edit profile cache maps

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Source Code Pro font not appearing in font lists

    5
    0 Votes
    5 Posts
    6k Views
    Chema Ramos RemesalC

    Thanks for the detailed information guy038!

  • Save all opened files to change date ?

    Locked
    2
    0 Votes
    2 Posts
    4k Views
    guy038G

    Hello Panteror,

    I’ve got a solution which implies a virtual search/replacement on all the opened files of a N++ session !

    Open the replace dialog ( CTRL + H )

    Check the Regular expression option ( IMPORTANT )

    Find what : .\Z

    Replace with : $0

    Click on the Replace All in All Opened Documents button

    => At once, all the opened tabs will turn “red

    Hit the ALT + F4 shortcut or the menu option File - Exit

    Press the Enter key, repeatedly, to valid the different save dialogs ( Save file C:\...... ? )

    Notes :

    In the search regex .\Z :

    The part . is a standard character, different from an End of Line character ( \r ) and ( \n ) and the Form Feed character ( \f )

    The zero-width assertion \Z represents the very end of the file, possibly preceded by any range of End of Line character(s) ( \r and/or \n )

    In replacement, this last standard character is just rewritten, as the regex $0 represents the entire matched regex, that is to say the last character itself !

    This method should not use much time to process : only one character per file X the amount of opened files, in N++ :-)

    Best regards,

    guy038

    P.S. :

    By the way, in a DOS console windows, you can change the modification and access date of a file or a set of them, without changing their contents, with the simple DOS command, below :

    copy name.txt + or copy *.txt + or, even, copy *.* + ( Tested on a Windows XP machine )

    The space, before the plus sign is not mandatory !

  • Find in Files

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Discogs Search

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied