• Notepad++ attempting to find specific text within brackets

    Moved
    8
    0 Votes
    8 Posts
    1k Views
    cs DavisC

    @Coises
    Thanks much Coises, dang too easy to overlook a simple space, its almost like trying to figure out a sound problem when it was the mute button that was hit.
    Thanks again

  • Text paragraph (re)formatting (and justification): how do it?

    6
  • Backup dosn't work in new session

    3
    0 Votes
    3 Posts
    337 Views
    Adro RA

    It’s a pity that there is no such functionality for subsequent instances :(

  • I want to transfer N++ files to another PC.

    4
    0 Votes
    4 Posts
    292 Views
    Luis Piña IIIL

    Thank you both!

  • Find line above given text in document

    27
    0 Votes
    27 Posts
    7k Views
    guy038G

    Hi, @benji2025, @ekopalypse, @alan-kilborn, @coises and All,

    I did additional tests :

    First, if the Word wrap option is enabled, using the same regex as before, with the Match Case option checked, the BookMarking operation took about the same time : 23.2 seconds

    Secondly, after the BookMarking operation if you re-run the same regex, the whole operation is done in 16 seconds. This seems logical because n++ does not have to re-bookmark the already bookmarked lines !

    Thirdly, if I do not check the Bookmark line option, in the Mark dialog, the Marking operation is a bit quicker : 19,4 seconds

    Fourthly, if I select all the contents of the test file ( => the In selection box is automatically checked ) the operation is a bit slower : 23,8 seconds

    Now, for all the tests below, I used these rules :

    The Word wrap option is unchecked

    In the Mark dialog, the Bookmark line option is checked and all the other box options are unchecked.

    Generally the Match case option is unchecked but may be checked in few occasions.

    Before each search, I hit the Clear all marks button and place the caret at the very beginning of the test file.

    I did my tests twice : on my old XP machine, with N++ v7.9.2 and on my new W10 laptop, with N++ v8.7.6 ( @coises, I avoided, on purpose, using the v8.7.8 and v8.7.9 releases ! )

    Each time, I opened N++, from a command prompt window, with the command Notepad++ -nosession Benji.txt Test_Benji.txt, so with only these two files.

    For the W10 test, I simply used an USB key containing the portable N++ v8.7.6 release and the test file.

    -------------------------- NEC XP - N++ v7.9.2 ------------------------------------------------------------------------------------------------------- (?-s)^.*\R(?=TEST$) 24 s Option 'Match Case' unchecked (?-s)^.*\R(?=TEST$) 23.1 s Option 'Match Case' checked ( The test in my **previous** post ) (?-s)^.+\R(?=TEST$) 23.9 s Option 'Match Case' unchecked (?-s)^.*+\R(?=TEST$) 19.9 s ( Atomic ) Option 'Match Case' unchecked (?-s)^.++\R(?=TEST$) 19.8 s ( Atomic ) Option 'Match Case' unchecked (?-s)^.++\r\n(?=TEST$) 18.6 s ( Atomic ) Option 'Match Case' unchecked (?-s)^.++\r\n(?=TEST$) 17.7 s ( Atomic ) Option 'Match Case' checked (?-is)^.++\r\n(?=TEST$) 69 s ( Atomic ) ( ?! ) Option 'Match Case' unchecked --- Without the ^ symbol --- (?-s).*\R(?=TEST$) 25.6 s Option 'Match Case' unchecked (?-s).+\R(?=TEST$) 23.1 s Option 'Match Case' unchecked (?-s).*+\R(?=TEST$) 21.5 s ( Atomic ) Option 'Match Case' unchecked (?-s).++\R(?=TEST$) 19.2 s ( Atomic ) Option 'Match Case' unchecked (?-s).++\r\n(?=TEST$) 18.1 s ( Atomic ) Option 'Match Case' unchecked (?-s).++\r\n(?=TEST$) 17.25 s ( Atomic ) Option 'Match Case' checked (?-is).++\r\n(?=TEST$) 237 s ( Atomic ) ( ?! ) Option 'Match Case' unchecked --- Without the (?-s)^ part --- .*\R(?=TEST$) 25.1 s Option 'Match Case' unchecked .+\R(?=TEST$) 22.8 s Option 'Match Case' unchecked .*+\R(?=TEST$) 21.2 s ( Atomic ) Option 'Match Case' unchecked .++\R(?=TEST$) 18.9 s ( Atomic ) Option 'Match Case' unchecked .++\r\n(?=TEST$) 17.8 s ( Atomic ) Option 'Match Case' unchecked .++\r\n(?=TEST$) 17 s ( Atomic ) Option 'Match Case' checked (?-i).++\r\n(?=TEST$) 236 s ( Atomic ) ( ?! ) Option 'Match Case' unchecked --- Using the @Terry-R solution --- (?-s).\R(?=TEST$) 77 s ( ?! ) Option 'Match Case' unchecked (?-s).\r\n(?=TEST$) 71 s ( ?! ) Option 'Match Case' unchecked (?-s).{1}+\R(?=TEST$) 93 s ( Atomic ) ( ?! ) Option 'Match Case' unchecked (?-s).{1}+\r\n(?=TEST$) 84 s ( Atomic ) ( ?! ) Option 'Match Case' unchecked .{1}+\R(?=TEST$) 88 s ( Atomic ) ( ?! ) Option 'Match Case' unchecked .{1}+\r\n(?=TEST$) 79 s ( Atomic ) ( ?! ) Option 'Match Case' unchecked --- After CONCATENATION of the line BEFORE the line TEST with the line TEST --- First, the regex \R(?=TEST$) is replaced with NOTHING ( 57 s ) => 142,908,950 bytes for 3,030,301 lines. Then : TEST$ 20.8 s Option 'Match Case' unchecked TEST$ 13.6 s Option 'Match Case' checked (?-i)TEST$ 13.8 s Option 'Match Case' unchecked Last, the regex TEST$ is replaced with \r\n$0 ( 65 s ) -------------------------- HP Win 10 - N++ 8.7.6 ----------------------------------------------------------------------------------------------------- (?-s)^.*\R(?=TEST$) 2,3 s Option 'Match Case' unchecked (?-s)^.*\R(?=TEST$) 2 s Option 'Match Case' checked ( The test in my **previous** post ) (?-s)^.+\R(?=TEST$) 2.3 s Option 'Match Case' unchecked (?-s)^.*+\R(?=TEST$) 1.9 s ( Atomic ) Option 'Match Case' unchecked (?-s)^.++\R(?=TEST$) 1.97 s ( Atomic ) Option 'Match Case' unchecked (?-s)^.++\r\n(?=TEST$) 1.86 s ( Atomic ) Option 'Match Case' unchecked (?-s)^.++\r\n(?=TEST$) 1.5 s ( Atomic ) Option 'Match Case' checked (?-is)^.++\r\n(?=TEST$) 5.8 s ( Atomic ) ( ! ) Option 'Match Case' unchecked --- --- Without the ^ symbol --- (?-s).*\R(?=TEST$) 2.7 s Option 'Match Case' unchecked (?-s).+\R(?=TEST$) 2.3 s Option 'Match Case' unchecked (?-s).*+\R(?=TEST$) 2.3 s ( Atomic ) Option 'Match Case' unchecked (?-s).++\R(?=TEST$) 1.9 s ( Atomic ) Option 'Match Case' unchecked (?-s).++\r\n(?=TEST$) 1.8 s ( Atomic ) Option 'Match Case' unchecked (?-s).++\r\n(?=TEST$) 1.45 s ( Atomic ) Option 'Match Case' checked (?-is).++\r\n(?=TEST$) 23.9 s ( Atomic ) ( !? ) Option 'Match Case' unchecked --- --- Without the (?-s)^ part --- .*\R(?=TEST$) 2.7 s Option 'Match Case' unchecked .+\R(?=TEST$) 2.23 s Option 'Match Case' unchecked .*+\R(?=TEST$) 2.23 s ( Atomic ) Option 'Match Case' unchecked .++\R(?=TEST$) 1.8 s ( Atomic ) Option 'Match Case' unchecked .++\r\n(?=TEST$) 1.7 s ( Atomic ) Option 'Match Case' unchecked .++\r\n(?=TEST$) 1.38 s ( Atomic ) Option 'Match Case' checked (?-i).++\r\n(?=TEST$) 24 s ( Atomic ) ( ?! ) Option 'Match Case' unchecked --- Using the @Terry-R solution --- (?-s).\R(?=TEST$) 6.35 s ( ! ) Option 'Match Case' unchecked (?-s).\r\n(?=TEST$) 8.6 s ( ! ) Option 'Match Case' unchecked (?-s).{1}+\R(?=TEST$) 8.2 s ( Atomic ) ( ! ) Option 'Match Case' unchecked (?-s).{1}+\r\n(?=TEST$) 10.6 s ( Atomic ) ( ! ) Option 'Match Case' unchecked .{1}+\R(?=TEST$) 7.5 s ( Atomic ) ( ! ) Option 'Match Case' unchecked .{1}+\r\n(?=TEST$) 9.75 s ( Atomic ) ( ! ) Option 'Match Case' unchecked --- After CONCATENATION of the line BEFORE the line TEST with the line TEST --- First, the regex \R(?=TEST$) is replaced with NOTHING ( 26.2 s ) => 142,908,950 bytes for 3,030,301 lines. Then : TEST$ 2.3 s Option 'Match Case' unchecked TEST$ 0.95 s Option 'Match Case' checked (?-i)TEST$ 1 s Option 'Match Case' unchecked Last, the regex TEST$ is replaced with \r\n$0 ( 25.3 s )

    Conclusion :

    So, given the rules above, the best syntaxes seem to be, on my new Windos 10 machine :

    The regex .++\r\n(?=TEST$) in 1.38 second, with the Match Case option checked.

    The regex TEST$ in 0.95 second, AFTER an initial contatenation of the line before the line TEST with the line TEST.

    Best Regards,

    guy038

  • ReGex help removing data

    7
    0 Votes
    7 Posts
    522 Views
    guy038G

    Hi, @dev-petty, @peterjones, @terry-r and All,

    Yes I was too rapid, directly answering, without testing in N++. My bad !

    So one correct syntax could be :

    SEARCH (?s-i)(?-s:^Born:.+).+?California\R

    REPLACE Leave EMPTY

    Check the Regular expression search mode

    What means this regex, except for the literal strings Born: and California ?

    The first part (?s-i) are initial modifiers which apply to the whole regex :

    The (?s) syntax means that any . regex char, found in the regex, may represent any single character, including the line-break \r and/or \n.

    The (?-i) syntax means that the search is done in an sensitive way ( so not insensitive ! ). Thus it will find the words Born and California but not the words born and california or BORN and CALIFORNIA. If an insensitive search is needed just use the (?si) syntax.

    The second part is (?-s:^Born:.+) which is a non-capturing group ( a group whose we do not need the contents, further on, in search and/or replacement !) (?:.........) with the -s modifier which applies to this group only. Thus, this part looks for the word Born, with that exact case, at the beginning of line ^, followed with a colon, itself followed with any standard character ., repeated +, till the very end of current line as it stops at the line-breaks.

    The third part is .+? which represents the smallest ? range of any character ., including \r and \r, repeated +, until …

    The fourth part California\R which represents the word California, with this exact case, followed by \R which stands for any kind of line-break ( \r\n for Windows files, \n for Unix files or \r for Mac files ).

    In replacement, as its zone is empty, the entire 4 lines matched are simply deleted !

    BR

    BR

    guy038

  • Concatinate files

    3
    0 Votes
    3 Posts
    290 Views
    Robert Or Janet DiebelR

    @PeterJones Thanx very much for your help

  • "Word wrap" option is reset from time to time

    20
    0 Votes
    20 Posts
    10k Views
    mathlete2M

    @PeterJones said in "Word wrap" option is reset from time to time:

    Thanks for that brutally harsh assessment of my writing

    I can see why you interpreted my general statement this way, and I apologize for any disrespect you felt as a result of that misunderstanding. However, I was not trying to imply anything negative about your general capabilities as a writer, or suggest that this particular piece of writing was unacceptable; I was just trying to make a point about the flaws/limitations of AK’s preceding comment.

    FWIW, AK’s argument actually made me think of the various instructors I had in undergrad: despite their in-depth knowledge of the course material, many of them lacked the technical communication skills to provide effective lessons.

    FWIW, I generally find your explanations on this forum exceptionally clear and easy to read, so I was surprised that this particular excerpt was a bit hard to follow on the first couple of run-throughs.

    @PeterJones said in "Word wrap" option is reset from time to time:

    you need to understand that (…) you do not get the final say into what’s accepted into the User Manual

    Of course - that’s why I literally offered the adjustments as suggestions. However, I think it’s worth pointing out that someone else independently offered very similar suggestions (albeit for a potentially different piece of writing). The fact that two independent sources are suggesting the use of the same argument structure is a strong indication that the structure is worth following.

    BTW, based on your multiple references to professional editors, you seem to be under the impression that I lack the experience required to give advice on writing structure. Given that you don’t know me personally, I’m not sure why you would make such an assumption; based on your other interactions on this forum, this seems out of character for you.

    Either way, it’s worth pointing out that part of my current job is reviewing the content of user manuals, and I’ve had plenty of similar experience long before I took on this job. So, I’m much more qualified to offer advice on matters like this than you seem to think.

  • menu right click

    5
    0 Votes
    5 Posts
    413 Views
    Graz FontG

    @Graz-Font I solved it. I edited the Windows registry to add a “MultipleInvokePromptMinimum” entry. Thanks to all for the suggestions, but it wasn’t a character length issue.

  • Is there an easy way to find and open a file in the current workspace?

    2
    0 Votes
    2 Posts
    393 Views
    Terry RT

    @Real-Cat

    There is another post similar in request to yours which might help.

    See this post.

    Terry

  • Does not save the settings: NotePad++ 8.7.8 Portable

    14
    0 Votes
    14 Posts
    765 Views
    PeterJonesP

    @Maxim-Fox ,

    config.xml for the settings, and stylers.xml for the default theme (other themes are in the themes subdirectory, and should be obvious based on which theme you use)

    see User Manual > Config Files
    https://npp-user-manual.org/docs/config-files/
  • deleting duplicate names this Coordination

    10
    0 Votes
    10 Posts
    589 Views
    guy038G

    Hello, @sabry-farg, @thomas-knoefel, @terry-r, @lycan-thrope and All,

    Oh…, @lycan-thrope, you’re perfectly right about it ! It’s a typo !

    So, @sabry-farg, I apologize for my mistabke !

    The correct regex is, indeed :

    FIND \|

    REPLACE \r\n

    BR

    guy038

  • Focus is on the menu (and not text area) after NP++ activation

    6
    0 Votes
    6 Posts
    647 Views
    fml2F

    The behaviour of the Alt key is weird and varies in different applications. I did the following experiments.

    Basic setup: Have some programs open so that they are displayed in the task bar

    Go to an application, i.e. have it as the “active” one Press the Alt key Point with the mouse to another application in the task bar and click. The application becomes the active one. Release the Alt key

    What I see is:

    If the target app is Mozilla Firefox or Thunderbird or VLC, the menu is reliably activated upon releasing Alt. If the target app is MS Excel, menu is never activated. Excel activates the menu (displays shortcuts) a second after pressing Alt, i.e. not upon releasing it. If the target app is NP++ or LibreOffice the behaviour after releasing Alt is unpredictable. Sometimes the menu is activated, sometimes it’s not.

    As I wrote, I remedy the situation by changing the key to one without Alt.

  • Style Tokens are lost between sessions.

    Moved
    8
    0 Votes
    8 Posts
    1k Views
    Alan KilbornA

    @guy038 said:

    did you forgot of your excellent Python script

    I didn’t exactly forget… :-)

    But some of the earlier comments in this topic have made me decide that it might be best to just not try to remember any previous styling. I’m even doubting remembering bookmarks now too. :-)

  • [Python] Replace spaces with tabs?

    3
    0 Votes
    3 Posts
    467 Views
    S

    @PeterJones Thanks much for the infos.

  • How to Hide Fold Lines in Notepad++?

    2
    0 Votes
    2 Posts
    343 Views
    mpheathM

    @pockytu

    Go to Plugin Admin, type fold into the Search box and keep clicking Next until you see Folding Line Hider. Check the checkbox and click the Install button. After Notepad++ restart, it should be active at hiding the fold lines.

    Description of the plugin:

    This Notepad++ plugin can hide the unsightly folding lines, and for convenience, you can fold and unfold the current level using the Alt + Left/Right keys.
    Author: leonardchai@gmail.com
    Homepage: https://github.com/leonardchai/FoldingLineHider

  • Translate interface buttons

    2
    0 Votes
    2 Posts
    361 Views
    Alan KilbornA

    @Max-Alekseyev

    The captions on those buttons are controlled by Windows instelf, not Notepad++.

  • Style/theme settings lost on every N++ update

    12
    0 Votes
    12 Posts
    2k Views
    mpheathM

    @peter-vasil

    The install directory is handled similar with the installer whether Don't use %AppData% is checked or unchecked. The main difference is the doLocalConf.xml existence which impacts how notepad++.exe saves to the xml files. When notepad++.exe saves to the install directory, then a risk exists when using the installer to upgrade which can overwrite customized xml files.

    Information from install logs:

    Files Install Upgrade Minimalist doLocalConf.xml extract extract extract autoCompletion\*.xml extract skip functionList\*.xml extract extract overrideMap.xml extract skip gup.xml extract extract contextMenu.xml extract skip skip tabContextMenu_example.xml extract skip skip toolbarButtonsConf_example.xml extract skip skip toolbarIcons.xml extract skip skip langs.model.xml extract extract extract stylers.model.xml extract extract extract shortcuts.xml extract skip skip nppLogNulContentCorruptionIssue.xml extract skip skip markdown._preinstalled.udl.xml extract extract extract markdown._preinstalled_DM.udl.xml extract extract extract DarkModeDefault.xml extract extract extract themes\*.xml extract extract

    Theme modifications in the install directory can be overwritten by the upgrade as that is what extract does.

    If Don't use %AppData% is checked:

    The default Custom type of upgrade install will extract many xml files so to keep customizations, may need to backup before install and merge after install.

    The Minimalist type of upgrade install will extract the least amount of xml files so is probably the safest to keep customized xml files.

    If Don't use %AppData% is unchecked:

    Modified xml files are saved to %AppData% so are safe.
  • 0 Votes
    6 Posts
    403 Views
    Fernando Fernandez EscalanteF

    @PeterJones I just tried it and it works perfectly. Thanks again so much for the help.

  • Need help with RegEx

    3
    0 Votes
    3 Posts
    315 Views
    Smudge the catS

    @PeterJones thank you so much for the help!!