• Npp crashes when NppFTP connects to the server

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    Pete NorrisP

    Scratch the question.

    Both my desktop and my laptop have Notepad++. NppFTP was crashing the Notepad++ on both computers.

    I am at a remove location now with my laptop. Notepad++ and NppFTP are working fine here.

    It must be my IP connection. I am using my Android as a hotspot.

    I apologize for taking everyone’s time.

  • 2 Votes
    6 Posts
    4k Views
    guy038G

    Hello, @ttm-1895, @claudia-frank and All,

    I think that the regex can be shortened, as below :

    (?s)(?<=\[).+?(?=\])

    Notes :

    The (?s) modifier means that the dot regex character ( . ) represents any single char ( either a standard one or an EOL one )

    The (?i) modifier is not necessary, as no letters or letter range(s) are involved in the discussed regexes

    The main part of the regex is the .+? syntax, which catches the smallest NON-empty range of any character, which, either :

    is preceded by a literal [ symbol, due to the (?<=\[) positive look-behind structure

    is followed with a literal ] symbol, due to the (?=\]) positive look-ahead structure

    Both [ and ] symbols must be escaped, with the \ symbol, to be interpreted as literals

    Cheers,

    guy038

  • How to repalce newlines to other characters with Extended Search

    Locked
    3
    1 Votes
    3 Posts
    1k Views
    Claudia FrankC

    @Shima-Hisaharu

    what you have posted and what you did describe doesn’t match.

    If you want to have it added you need to replace with \n\ta

    But from what you’ve posted as result you want to insert it in front of \n
    which means you need to replace with \ta\n.

    Find is, for both, like you already did \n

    Cheers
    Claudia

  • Need help changing a number section in these text files for a game

    Locked
    6
    1 Votes
    6 Posts
    1k Views
    Terry RT

    Great answer @guy038 ! And of course for any newbies on this forum the definition of a regex is most likely the search string used only when under the ‘extended’ or ‘regular expression’ modes of search , find and replace, using the ‘metacharacter’ options made available. Because that’s where your ‘literal’ example turns into a ‘regex’.

    When using the ‘normal’ mode or looking at a very simple string search as in this instance I probably should refrain from using the ‘regex’ word.

    Thanks for the clarification.

    Terry

  • Find in all files not working for me?

    Locked
    5
    0 Votes
    5 Posts
    1k Views
    PeterJonesP

    Thanks for the vote of confidence. I’ve added it.

  • Help with regular expression.

    Locked
    9
    1 Votes
    9 Posts
    2k Views
    Claudia FrankC

    That’s the wonderful world of regex - multiple solutions for one problem :-)

    Cheers
    Claudia

  • Viewing infected PHP file I don't see the dangerous code

    Locked
    3
    0 Votes
    3 Posts
    947 Views
    Robert H. MorrisonR

    Problem resolved, I need to activate View - Show Symbol - Show Whitespace and TAB.
    THEN we can see the … and no there is something at the end of the line,
    or, alternatively I could turn on Word Wrap!

  • How to Recover Unsaved and deleted Notepad++ files?

    Locked
    2
    0 Votes
    2 Posts
    9k Views
    PeterJonesP

    Open-but-unsaved files live in %AppData%\Notepad++\Backup (assuming you have the Settings > Preferences > Backup > Enable session snapshot and periodic backup enabled – which I believe you do, since you seem to have the expectation that unsaved files are somehow “safe”).

    Assuming your recovery wizard (or however their trademark spells it) recovered your %AppData% (or if your %AppData% is on C: instead of D:, and thus isn’t deleted), then it could be that your unsaved files are available in %AppData%\Notepad++\Backup.

    Otherwise, if recovery software hasn’t helped, there’s not much more to be done. This might be a good lesson to you that with any application that edits files (not just Notepad++), even if it has auto-save of some sort, you need to take ownership for the task of preserving data; the more important your data is, the more important it is that you play an active role in saving and backing up that data.

  • How to make style configurator work on CSS inside html

    Locked
    2
    0 Votes
    2 Posts
    858 Views
    Claudia FrankC

    @abdulbadii

    there is no npp builtin way to use two different lexers in one document but a possible
    workaround might be using some technique like discussed here. As I don’t have any experience in css I’m not sure if this can be done easily.

    Cheers
    Claudia

  • Filter lines

    5
    0 Votes
    5 Posts
    2k Views
    guy038G

    Hi, @terry-r and All,

    In your last post, Terry, the (?|\R|\z) regex syntax is, for instance, a branch reset group structure. However, as it is said here :

    If you don’t use any alternation or capturing groups inside the branch reset group, then its special function doesn’t come into play. It then acts as a non-capturing group.

    So, I don’t think that, in that specific case, the branch reset group syntax was necessary ;-))

    And for everybody, to, clearly, show the difference between a capturing list of alternatives and a branch reset group, let’s consider the two following regexes, which matches, either, one of the 5-chars strings : axyzw, apqrw or atuvw

    A) with a list of consecutive alternatives, in a capturing group :

    (a)(x(y)z|(p(q)r)|(t)u(v))(w)

    When the regex matches axyzw, group 1 = a, group 2 = x(y)z, group 3 = y and group 8 = w

    When the regex matches apqrw, group 1 = a, group 2 = (p(q)r), group 4 = p(q)r, group 5 = q and group 8 = w

    When the regex matches atuvw, group 1 = a, group 2 = (t)u(v), group 6 = t, group 7 = v and group 8 = w

    B) with a branch reset group ( NOT a capturing group itself ! ) :

    (a)(?|x(y)z|(p(q)r)|(t)u(v))(w)

    When the regex matches axyzw, group 1 = a, group 2 = y, group 3 is undefined and group 4 = w

    When the regex matches apqrw, group 1 = a, group 2 = p(q)r, group 3 = q and group 4 = w

    When the regex matches atuvw, group 1 = a, group 2 = t, group 3 = v and group 4 = w

    An other example. Given that text :

    abcdefg hijklmn opqrstu

    The regex S/R :

    SEARCH (abcdefg)|(hijklmn)|(opqrstu)

    REPLACE ==\1\2\3== OR, also, ==$0==

    would change the text as :

    ==abcdefg== ==hijklmn== ==opqrstu==

    Note that, in the syntax ==\1\2\3==, only one group is defined, at a time and the two others are just “empty” groups !

    Now, with the same initial text, the regex S/R, below :

    SEARCH ab(cde)fg|hi(jkl)mn|op(qrs)tu

    REPLACE ==\1\2\3==

    gives :

    ==cde== ==jkl== ==qrs==

    whereas the following regex S/R, with a branch reset group and only group 1, in replacement :

    SEARCH (?|ab(cde)fg|hi(jkl)mn|op(qrs)tu)

    REPLACE ==\1==

    would produce the same results

    …and the regex S/R :

    SEARCH (?|ab(cde)fg|hi(jkl)mn|op(qrs)tu)

    REPLACE ==\1\1\1==

    would give :

    ==cdecdecde== ==jkljkljkl== ==qrsqrsqrs==

    Best Regards,

    guy038

  • 0 Votes
    19 Posts
    6k Views
    Claudia FrankC

    @Χρήστος-Κοτζιάς

    Yes, I’m able to see your uploaded image.
    What is your question or what did I miss?

    Cheers
    Claudia

  • Notepad++ lifecycle information

    Locked
    2
    0 Votes
    2 Posts
    4k Views
    Claudia FrankC

    @Tony-Montana

    npp doesn’t do such thing as it always supports the last recent version only.
    I never saw that a particular version was patched.

    When something is wrong and a developer finds some time and interest to fixed it
    and Don accepts the PR than this will go into one of the next versions of npp.

    Cheers
    Claudia

  • Colored keywords in XML

    18
    1 Votes
    18 Posts
    12k Views
    Claudia FrankC

    @Kriz-Smee

    I would suggest to deliver an xml schema together with your software and
    a short description on how to use it together with the xml tools plugin.

    Multiple free software is available to let the schema being created for you,
    if you want to avoid learning how to create one from scratch.
    https://www.w3schools.com/xml/schema_intro.asp

    Cheers
    Claudia

  • Customizable output for Find All in Current Document output window?

    Locked
    7
    1 Votes
    7 Posts
    2k Views
    Greg WernerG

    Thanks, didn’t realize Plugin Manager was gone. Once I installed that, I was able to install Python Script and that should be enough to get me on my way. Thanks again.

  • beginner looking for regex to find & replace

    Locked
    4
    1 Votes
    4 Posts
    1k Views
    Claudia FrankC

    @krat-chouf

    one way would be to define the remaining part as part of a regex lookahead,
    which basically means something like: this only matches if the following text follows.
    So in your case and what has been already discussed you could modify it like

    find: (?is)(<group name\=“caliper”>.+?“offset”).+?(?=>.*?</item>)
    replace: \1 units=“micron” loLimit="-50" hiLimit=“50”

    Cheers
    Claudia

  • MERLIN-PRO ASSEMBLER SYNTAX HIGHLIGHTING

    Locked
    2
    0 Votes
    2 Posts
    854 Views
    PeterJonesP

    The UDL (User Defined Language) lexer is not set up for highlighting random words, or even words that match a certain regular expression.

    If you want any unrecognized word to be a certain color, pick that certain color as the default color for your UDL, and make sure that all known words (like the EQU listed above) are in one of the keyword lists.

    You might want to study this other Topic in the forum, where @Claudia-Frank shared PythonScript code which will do customized highlighting; it was shown with an example of highlighting Python differently than the normal Python lexer does… but you might be able to make it do what you want. (Note: once you get to the post where Claudia shows the screenshot and the PythonScript code, the relevant content of that thread is complete; it kind of went off on a tangent after that. :-) ) I’m sure if you @-mention @Claudia-Frank here or in that thread, she’ll be happy to answer questions you might have on how to make it work for your use case (assuming it’s possible; I’ve never used that code).

  • Is it possible to run text through an external program?

    Locked
    3
    1 Votes
    3 Posts
    4k Views
    bcosellB

    @PeterJones Perfect… thanks very much!!

  • Showing the last line in a code fold. Possible?

    Locked
    2
    0 Votes
    2 Posts
    788 Views
    dailD

    Unfortunately it can not be done without significant C++ code changes.

  • 0 Votes
    3 Posts
    1k Views
    PeterJonesP

    Your subject line and the example are not specific enough, and possibly contradict each other:

    The subject says you want to remove all lines before the first : in the file if there are two :s in the file. That would say that

    first line second line hello : second : here

    would become

    hello : second : here

    But your example doesn’t seem to agree.

    Based on your example, I assume you want something like:

    hello:pig:cake hello;pig;cake -- note, this line is semicolons, not colons hello:pig:cake

    to become

    :pig:cake hello;pig;cake -- note, this line is semicolons, not colons :pig:cake

    Could you please give a bigger example document, showing us both the before and after? (To include your text verbatim, as I have, prefix every line in the text by 4 spaces, with a blank line before and after)

    Also, show what you tried.

    this faq will give you a good start on regular expressions.

    If you give a fuller explanation of what you want, and some indication that you’re willing to put in effort and learn, you’ll probably get one or more answers in short order. (Though it’s the weekend, so “short order” might be Monday. Ahh, @Terry-R showed up, so you might even get it sooner. Depends on who’s around when you clarify things.)

  • How do I search for non regular expression values?

    Locked
    2
    0 Votes
    2 Posts
    805 Views
    PeterJonesP

    Search > Find
    In the Find What, enter your regular expression.
    In the Search Mode section, enable the ☑ Regular Expression