• Find in selected text.

    Locked
    7
    0 Votes
    7 Posts
    6k Views
    guy038G

    Hi, @Scott-sumner,

    As for me, Scott, the Ctrl + Shift + 0 shortcut works as expected ! Just a remark : After several hits on the Ctrl + 0 shortcut, I noticed that the FIRST Ctrl + Shift + 0 action, moves cursor from the end to the beginning of the current marked range selected :-))

    And later hits on Ctrl + Shift + 0 matches, in upwards direction, previous marked zones, with the caret, normally, at beginning of each selection !

    Cheers,

    guy038

  • Append third row of text to a find replace?

    Locked
    9
    0 Votes
    9 Posts
    3k Views
    guy038G

    Hello, @Matthew-suhajda, and All,

    Pleased to hear that it worked fine ! Just for information :

    Regarding the first S/R :

    SEARCH (?-s)^(?:.*\R){2}(.+)(?s).+

    REPLACE $0\r\n\1

    The modifier (?-s) means that, further dots will match any single character, only

    Then, the part ^(?:.*\R){2} looks for the first two lines, with their EOL chars, in a non capturing group

    Now, the part (.+) stores, as group 1, the next 3rd line, without its End of Line characters

    Finally, the (?s).+ syntax catches all remaining text from End of Line characters of line 3

    In replacement, due to the $0 syntax, it re-writes, first, the entire matched text ( = file contents ), followed with a Windows line break ( \r\n ) and, finally, with the group 1 ( = The 3rd line = time stamp )

    Regarding the second S/R :

    SEARCH (?i)foo(?s)(?=.*\R(.+)\z)|(?-s)\R.+\z

    REPLACE ?1foo\x20\1

    The searched regex is made of two alternatives, separated by the alternation special character | :

    (?i)foo(?s)(?=.*\R(.+)\z)

    (?-s)\R.+\z

    In the first alternative, the part (?i)foo tries, first, to match the foo word, in any case

    Then, the (?s)(?=.*\R(.+)\z) syntax represents an always true look-ahead, (?=......), which matches all text after the foo word, till the second to the last line ( .*\R ), and the last ( or 3rd ) line, without any line-break ( (.+)\z ), which is stored as group 1

    Near the end of each file, the second alternative, (?-s)\R.+\z, looks for the very last ( or 3rd ) line contents, till the very end of each file ( \z )

    In replacement, the ?1foo\x20\1 syntax means :

    If group 1 exists, it rewrites the entire matched string foo, followed with a space character and the time stamp ( last ) line ( \1 )

    If group 1 does not exist ( case of the second alternative ), the very last line, temporarily added, is then, simply, deleted, as no ELSE part is present in the conditional replacement ?1..... !

    Best Regards,

    guy038

  • Only one Theme in Style Configurator

    6
    1 Votes
    6 Posts
    64k Views
    PolcmodsP

    Experienced the same problem today (Win10, installed logged in as administrator).

    Problem: User’s folder %appdata%\Notepad++\ does not contain folder themes.

    Solution: Copy the folder themes from administrator’s %appdata%\Notepad++\ and restart notepad++

  • Problem validating XML

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    chcgC

    Using what n++ 7.5.4 with xml tools plugin 2.4.9.2?
    32bit/64bit?
    Syntax check is ok?

  • What format to save file to run?

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Nancy BaileyN

    In order to run code there need to be some kind of interpreter/compiler/linker available
    for your language.

    Ahhh, I suspected. I’m new to all this and was confused because in class we “ran” pseudocode programs from npp (without programming in a proper language…maybe the computers in class have a plugin or setting that I don’t on mine??) and I thought I could do the same with these modules. Thank you for your time and information!

  • View/edit two files side by side in a single NP++ instance?

    Locked
    4
    2 Votes
    4 Posts
    2k Views
    Tom DemlerT

    OK, I suspected there had to be a way to do this but it wasn’t obvious to me. Thanks for the quick reply.

  • How to copy some of text ?

    Locked
    2
    0 Votes
    2 Posts
    995 Views
    Claudia FrankC

    @Guillaume-Fortunier

    as I’m not 100% sure what you try to achieve here an assumption
    what you can probably do

    open find replace dialog, check regular expressions and put the following
    into find what field

    "spotify:album:.+?"

    then goto MARK tab, check bookmark line and press mark all.

    Now you should have a lines bookmarked which satisfy the regular expression.
    Check menu Search->Bookmarks to see what you can do with those marked lines.

    Cheers
    Claudia

  • Regex: How to replace the content of a tag

    Locked
    4
    0 Votes
    4 Posts
    1k Views
    Vasile CarausV

    Search: (?:\G(?!^)|<title>)[^<]*?\K\b!\B

    Replace by: (leave a space)!

  • Slick way to remove line numbers from text

    Locked
    2
    0 Votes
    2 Posts
    18k Views
    guy038G

    Hello @kent-hartland,

    Thanks for sharing this easy utility !

    However, you can achieve it, quickly enough, using regular expressions, in search/replacement, within N++ ;-))

    Open your file, in N++

    Eventually, do a normal selection of the lines to be processed

    Open the Replace dialog ( Ctrl + H)

    Type in the regex ^\h*\d+ , in the Find what: zone

    Leave the Replace with: zone EMPTY

    If you did a selection, tick the In selection option. Otherwise, tick the Wrap around option

    Select the Regular expression search mode ( IMPORTANT )

    Click on the Replace All button

    Et voilà !

    Note that this regex is, simply, an approximation of what that small utility does ! Indeed, this program :

    Considers, only, the usual latin digits ( with Unicode value, from \x{0030} to \x{0039} ) as numbers to be deleted, instead of all Unicode numbers or similar, of any language !

    Considers the first dot character ( . ), located right after a number, as a character to be deleted, too !

    Considers all possible Unicode White space character ( except for the New Line character, \x{0085} ) , between the End of Line characters of the previous line and the numbers, of the current one, as characters which have to be deleted , as well. Refer, for that topic, to :

    http://www.unicode.org/Public/UCD/latest/ucd/PropList.txt

    So, assuming you would add a line-break, at the very beginning of your file, an exact search regex could be :

    (\r\n|\r|\n)\K[^\S\x85]*[0-9]+\.?

    Just for information, this regex :

    First, the part (\r\n|\r|\n) tries to match some End of line character(s)

    Then, the \K syntax reset the regex engine search process and position

    Now, the part [^\S\x85]* finds the longest sequence, possibly empty, of White Space characters, different of \x{0085}

    After, the part [0-9]+ simply looks for the longest non-empty range of classical digits

    Finally, the syntax \.? searches a possible literal dot

    Remark :

    The part [^\S\x85] is difficult enough to understand : this negative class of characters [^...] represents a single character, which is DIFFERENT from, BOTH :

    Any Unicode NON-Space character ( \S )

    The New Line character ( \x{0085} )

    Best Regards,

    guy038

  • A Plug-In that adds "persistent" line numbers to text?

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Kent HartlandK

    Indeed, it is a nice editor! I like it!

    Thanks, Cipher-1024, that solved my Line Numbering and Commenting Out Code questions.

  • To save as XML file

    Locked
    4
    0 Votes
    4 Posts
    29k Views
    Scott SumnerS

    @Jan-Kolthof

    Why don’t you tell us exactly what you are doing, then maybe someone will see something in that which will aid in solving your problem?

    SCENARIO:
    If I create a new file (File -> New), then I make some changes to the document tab that gets created from that, then I do File -> Save and Notepad++ prompts me with a “Save As” dialog box, I type “test.xml” for the File name box, click OK and Notepad++ saves my XML as I specified. When I go look at where I saved it with Explorer, it is there. If I then open the test.xml file in standard Windows notepad.exe, the data that I put in the file with Notepad++ was there.

    So not only have I showed that the problem you seem to be experiencing isn’t a problem for me, I’ve also educated you about how to describe what you are doing, how to explain what you expect, and then how to verify (with an independent tool) that you got (or in some cases, didn’t get) what was desired.

  • 0 Votes
    5 Posts
    2k Views
    iverson4664I

    @Claudia-Frank said:

    automatic document spell check

    Sorry to hear about that, npp minimalist version was slower on my computer, and the npp without DSpellCheck was stll slow. And I have tried some older npp version, the problem was there yet.
    I guess the problem or compatiblity issue was from my OS, what should I do…

  • List of most recent files when clicking on File is very old

    Locked
    4
    0 Votes
    4 Posts
    1k Views
    Claudia FrankC

    @Abraham-Bruck

    tried with different, 7.5.1, 7.5.4 (x32 and x64).

    So, is the issue that you cannot see a file in the list when you close it?
    You can check this immediately.

    Cheers
    Claudia

  • 0 Votes
    2 Posts
    937 Views
    Claudia FrankC

    @John-Birkenstamm

    could you post the debug-info, available under ? menu?
    Does this also happen if you start npp without plugins? (temporarily rename plugins directory)

    Cheers
    Claudia

  • 0 Votes
    3 Posts
    2k Views
    David BainesD

    Thanks Claudia, that’s a great idea! I’d thought about using a macro but I wasn’t sure how to get a macro to ‘know’ the line number to jump back to. This works well.

    In case it is useful to anyone else I couldn’t record a macro using CTRL + Z and CTRL + Y and then save it. When I tried that the ‘Save Current Recorded Macro’ option was greyed out. However when I recorded a macro using the Edit Menu options Undo and Redo I was able to save it.

    So now I have Alt + Space as a shortcut to Jump to last edit which is useful.
    Many Thanks.

  • functions in c++

    Locked
    4
    0 Votes
    4 Posts
    2k Views
    Claudia FrankC

    @Nidhi-Devi

    Ok, so not related to Npp at all I guess.

    The error message is quite clear in your case,

    g++: error: Num.cpp: No such file or directory

    g++ tries to find the file Num.cpp but failed because
    it doesn’t exists, it isn’t in the same directory as your main.cpp,
    isn’t in a directory where PATH variable points to and
    isn’t in a directory where your include statements point to.

    But in general I would think that if you post c/c++ programming questions
    to a dedicated c/c++ programming forum, you might get faster and better answers.
    This forum is mainly about using/working with notepad++

    Cheers
    Claudia

  • Add XML Tools item to Context Menu

    Locked
    7
    0 Votes
    7 Posts
    4k Views
    Manuel ColladoM

    It works now!!
    Thank you Claudia

  • 0 Votes
    17 Posts
    6k Views
    Jason ClarkJ

    @Chip-Cooper Thank you, this finally answered my question about autocomplete! I wish it were documented better. Thanks!

  • Regular Expression: Duplicate String to the first ';' on every line

    Locked
    2
    1 Votes
    2 Posts
    2k Views
    Scott SumnerS

    @Cuerda

    It might give some insight into where you are going wrong by explaining what you’ve tried already…knowing this maybe we could offer hints about why it didn’t work…with this maybe you could maximize your learning. :-)

    However, this seems to meet the spec provided:

    Find-what zone: ^"[^"]+";
    Replace-with zone: $0$0

    Explanation of the Regular Expression (brought to you by RegexBuddy)

    FIND:

    Assert position at the beginning of a line (at beginning of the string or after a line break character) (carriage return and line feed, form feed) «^» Match the character “"” literally «"» Match any character that is NOT a “"” «[^"]+» Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+» Match the character string “";” literally «";»

    REPLACE:

    Insert the whole regular expression match «$0» Insert the whole regular expression match «$0»

    …And here’s some subliminal messages for ya:
    IF YOU USE REGEX, BUY A RegexBuddy LICENSE
    IF YOU USE REGEX, BUY A RegexBuddy LICENSE
    IF YOU USE REGEX, BUY A RegexBuddy LICENSE
    …OK, enough of that…

  • Regular expression to delete specified text between html Tags

    Locked
    6
    1 Votes
    6 Posts
    3k Views
    Scott SumnerS

    @Lonnie-Hailey said:

    Is there anything I can do for you in this forum to show my appreciation?

    HAHA, well I really don’t care about this, but about the only thing you could do is “upvote”…see where it says ^ 0 v on the right? Click on the ^ !

    :-D