• Python script plugin alternative working with python 3?

    Locked
    5
    0 Votes
    5 Posts
    3k Views
    YaronY

    You’re welcome.

  • How can i use HTML and CSS in the same document?

    Locked
    4
    0 Votes
    4 Posts
    2k Views
    Scott SumnerS

    I do maintain that it is not a Notepad++ question. It is a question about the CONTENT of a file you can create with any text editor. But, in the spirit of trying to be helpful, there might be something of use at the link below (don’t really know, I’m not into HTML/CSS):

    http://lmgtfy.com/?q=html+and+css+in+same+file

  • Replace text between tag only if specified text appears in parent tag

    3
    0 Votes
    3 Posts
    5k Views
    Paul FlintP

    Thank you for your help.

  • Delete most of the text of the file

    5
    0 Votes
    5 Posts
    2k Views
    guy038G

    Hi, Vincent,

    Do you mean that your file may contain lines, as below, that you would like to delete ?

    1 Elevator de chantier 1L01522838425 1 Housse de couette Bibi 1L01522838521

    If so, a possible regex syntax, for that S/R, would be :

    SEARCH (?-s)^.+ (.+) €.*|^(?!.+€).*\R , with a space, before the first opening parenthesis an a second space character, after the first closing one !

    REPLACE ?1\1

    Notes :

    From beginning of the line, ^ :

    The first alternative is almost identical to the search regex of my previous post. I just added the syntax .* at the end of the first branch, in order to match all subsequent characters, after the last character

    The first part of the second branch of the alternative, (?!.+€) is a condition, called a negative look-behind, which means “NO Euro sign, exists, further on, in the current line ?”

    If this condition is TRUE, then, the regex engine matches the second, and main, part, of the second branch, .*\R. In other words, all the contents, even empty, of the current line, with its EOL characters

    In replacement, IF group 1 ( the price ) exists, we just rewrite that group 1 ( the value), ELSE we do not rewrite anything => All the current line, with the EOL character(s), included, is deleted

    So, from the original text, below :

    A Elevator de chantier 1L01522838425 110,30 € 110,30 € C Elevator de chantier 1L01522838425 D Oreillet bleu 1L01522839954 51.26 € 51.26 € F Housse de couette Bibi 1L01522838521 G Housse de couette Bibi 1L01522838521 86.20 € 86.20 € I Elevator de chantier 1L01522838425 27,10 € J Oreillet bleu 1L01522839954 734.56 € K Housse de couette Bibi 1L01522838521 0,99 € M Elevator de chantier 1L01522838425 1.00 € Test N Oreillet bleu 1L01522839954 99,99 € small test O Housse de couette Bibi 1L01522838521 57.34 € A Test

    The regex S/R, above, would get the final text, below :

    110,30 51.26 86.20 27,10 734.56 0,99 1.00 99,99 57.34

    REMARKS :

    If the price is present, only once, it doesn’t matter : The price will be displayed

    If some text is present, after the last Euro character , it will be deleted, too

    If you prefer to keep the pure blank lines, use, instead :

    SEARCH (?-s)^.+ (.+) €.*|^(?!.+€).+\R

    REPLACE ?1\1

    And you’ll obtain the changed text, below :

    110,30 51.26 86.20 27,10 734.56 0,99 1.00 99,99 57.34

    Cheers,

    guy038

  • Regex search/replace wildcard

    8
    0 Votes
    8 Posts
    30k Views
    guy038G

    Hello, Ryan, Claudia, AdrianHHH and All,

    Ryan, see the main differences, between the four simple regexes, below ( I suppose a sensitive search ) :

    a.*z matches a lowercase letter a, followed by the LONGEST range of characters, even EMPTY, till a lowercase letter z a.*?z matches a lowe-case letter a, followed by the SHORTEST range of characters, even EMPTY, till a lowercase letter z a.+z matches a lowercase letter a, followed by the LONGEST range of characters, NON empty, till a lowercase letter z a.+?z matches a lowercase letter a, followed by the SHORTEST range of characters, NON empty, till a lowercase letter z

    Just try these four regexes, with the subject text : az abcxyz az abz abxz abcxyz az ab bcxz abcx, in a new tab. The differences are quite obvious !

    AdrianHHH, you shouldn’t be annoyed, about choosing between the two syntaxes, below, as they are strictly identical !

    (?-s)alignment=".*?"

    alignment="[^"\r\n]*"

    Similarly, the two syntaxes, below, are strictly identical, too :

    (?s)alignment=".*?"

    alignment="[^"]*"

    The reason is that you reach a final UNIQUE character ( a quote mark ) "

    Now, I’m speaking to everybody ! For instance, do NOT confuse these two regexes :

    The regex 123.+?5, that means : A string 123 followed by the SHORTEST, NON-empty, range of characters, till a digit 5

    And the regex, almost identical, 123.+?56, which

    Does NOT mean : A string 123 followed by the shortest, NON-empty, range of characters, till a digit 5, then the 6 digit

    But means : A string 123 followed by the SHORTEST, NON-empty, range of characters, till the string 56

    So, against the subject text 012345789 0123456789 012345789 0123456789, the first regex 123.+?5 finds four occurrences, whereas the the second regex 123.+?56 would, only, find two occurrences !

    Here is a summary example :

    Let’s imagine the text, below, where the string abcdlmpqrst is repeated, 10 times, with, sometimes, the lack of the letters p and/or q :

    q missing q missing pq missing p missing p missing pq missing q missing p missing abcdlmprst abcdlmprst abcdlmrst abcdlmpqrst abcdlmqrst abcdlmqrst abcdlmrst abcdlmpqrst abcdlmprst abcdlmqrst

    Against this text, let’s try, successively, the 20 regexes, below, where the last fourteen contains the [^...] structure :

    Regex A : (?-s)ab.+p
    Regex B : (?-s)ab.+q
    Regex C : (?-s)ab.+pq

    Regex D : (?-s)ab.+?p
    Regex E : (?-s)ab.+?q
    Regex F : (?-s)ab.+?pq

    Regex G : ab[^p\r\n]+p
    Regex H : ab[^q\r\n]+q

    Regex I : ab[^p\r\n]+?p
    Regex J : ab[^q\r\n]+?q

    Regex K : ab[^q\r\n]+p
    Regex L : ab[^p\r\n]+q

    Regex M : ab[^q\r\n]+?p
    Regex N : ab[^p\r\n]+?q

    Regex O : ab[^p\r\n]+pq
    Regex P : ab[^q\r\n]+pq
    Regex Q : ab[^pq\r\n]+pq

    Regex R : ab[^p\r\n]+?pq
    Regex S : ab[^q\r\n]+?pq
    Regex T : ab[^pq\r\n]+?pq

    Here are the results, where each match is indicated by a range of dashes

    q missing q missing pq missing p missing p missing pq missing q missing p missing abcdlmprst abcdlmprst abcdlmrst abcdlmpqrst abcdlmqrst abcdlmqrst abcdlmrst abcdlmpqrst abcdlmprst abcdlmqrst A --------------------------------------------------------------------------------------------------------------- B ---------------------------------------------------------------------------------------------------------------------------- C -------------------------------------------------------------------------------------------------- D , G , I ------- ------- ------------------- --------------------------------------------- ------- E , H , J ---------------------------------------------- ------- ------- -------------------- -------------------- F ---------------------------------------------- ---------------------------------------------- K --------------------------------------------- ------------------- ------- L -------------------- ------- M ------- ------- ------------------- ------------------- ------- N ------- ------- ------- O , R -------------------- ---------------------------------------------- P , S ---------------------------------------------- -------------------- Q , T -------------------- --------------------

    Just notice that, as I said, above :

    The regex D, (?-s)ab.+?p, DOES have an equivalent regex G, ab[^p\r\n]+p, with the [^.....] structure

    The regex E, (?-s)ab.+?q, DOES have an equivalent regex H, ab[^q\r\n]+q, with the [^.....] structure

    but :

    The regex F, (?-s)ab.+?pq, does NOT have an equivalent regex, containing the [^.....] structure

    Note, also, that :

    The regexes O, ab[^p\r\n]+pq, and R, ab[^p\r\n]+?pq are equivalent

    The regexes P, ab[^q\r\n]+pq, and S, ab[^q\r\n]+?pq are equivalent

    The regexes Q, ab[^pq\r\n]+pq, and T, ab[^pq\r\n]+?pq are equivalent

    Why ? Just because the range of characters, after the string ab, must NOT contain a part or the totality of the string pq. In other words, theses six regexes, from O to T, always look for the shortest range of characters, between the string ab and the string pq !

    Best Regards,

    guy038

    P.S. : Ryan, for your regex “education”, just begin with that article, in N++ Wiki :

    http://docs.notepad-plus-plus.org/index.php/Regular_Expressions

    In addition, you’ll find good documentation, about the new Boost C++ Regex library, v1.55.0 ( similar to the PERL Regular Common Expressions, v1.48.0 ), used by Notepad++, since its 6.0 version, at the TWO addresses below :

    http://www.boost.org/doc/libs/1_48_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html

    http://www.boost.org/doc/libs/1_48_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html

    The FIRST link explains the syntax, of regular expressions, in the SEARCH part

    The SECOND link explains the syntax, of regular expressions, in the REPLACEMENT part

    You may, also, look for valuable informations, on the sites, below :

    http://www.regular-expressions.info

    http://www.rexegg.com

    http://perldoc.perl.org/perlre.html

  • Search and Replace

    3
    0 Votes
    3 Posts
    3k Views
    guy038G

    Hello Max,

    So, from you example, below, I suppose that you would like to change the value 625 of the tag size, for an other one, whatever the contents of the two previous lines are ?

    officers = { culture = pashtun #This doesnt matter, they vary. religion = sunni #This doesnt matter either, they vary. size = 625 #I want to change this. }

    Well, I think that a good search/replacement, using regular expressions, could be :

    SEARCH (?s-i)^officers.+?size = \K\d+

    REPLACE <some digits> ( The new value of the tag size )

    So :

    Open your file, in Notepad++

    Open the Replace dialog ( Ctrl + H )

    Fill the Find what field with the above regex

    Fill the Replace with field with a new integer value, for the tag size

    Uncheck, preferably, the Wrap around option

    Click, EXCLUSIVELY, on the Replace All button ( DON’T use the Replace button, for a step by step replacement. Indeed, nothing is changed, in that case ! )

    Et voilà !

    If you’re a newby, about regular expressions concept and syntax, begin with that article, in N++ Wiki :

    http://docs.notepad-plus-plus.org/index.php/Regular_Expressions

    In addition, you’ll find good documentation, about the new Boost C++ Regex library, v1.55.0 ( similar to the PERL Regular Common Expressions, v1.48.0 ), used by Notepad++, since its 6.0 version, at the TWO addresses below :

    http://www.boost.org/doc/libs/1_48_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html

    http://www.boost.org/doc/libs/1_48_0/libs/regex/doc/html/boost_regex/format/boost_format_syntax.html

    The FIRST link explains the syntax, of regular expressions, in the SEARCH part

    The SECOND link explains the syntax, of regular expressions, in the REPLACEMENT part

    You may, also, look for valuable informations, on the sites, below :

    http://www.regular-expressions.info

    http://www.rexegg.com

    http://perldoc.perl.org/perlre.html

    If you’re, already, fairly acquainted with regexes, here are, below, some notes about this specific regex :

    The first part (?s-i), of the **search regex, are two modifiers :

    The first one, (?s), forces the dot special character to represent any single character ( a standard character or an EOL character )

    The second one, (?-i), forces the regex engine to do this search/replacement, in a sensitive case way

    The part ^officiers, looks, for beginning of the line, ^, for the string officiers, in that exact case

    Then, the part .+?size = , tries to match the shortest, non-null, range of any character, till the string size =, with a space character, after the equal sign ( Why the shortest ? Because it must be located inside the officiers {......} block ! )

    Now, the \K form, forces the regex engine to forget everything that was previously matched and resets the caret location to the position between the space character, after the equal sign, and the first digit of the size value

    Finally, the part \d+ matches all the digits of the size’s value

    In replacement, just type the new value of the size tag, which will replace the old value

    But, I guess that you showed your example, split, in several lines, in order to tell us, about the right zone to be changed ! So your text would rather be written, as below :

    officers = { culture = pashtun religion = sunni size = 625 }

    In that case, the search regex should be, simply re-written, as below :

    (?-si)^officers.+size = \K\d+

    This time, the part .+ represents the longest range of standard characters only, of the current line ( due to the (?-s) modifier ), till the string size =, with a space character after the equal sign

    Best Regards,

    guy038

  • Kind of autocomplete?

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Gökalp GürselG

    I will definitely check this, thanks for answering and taking your time to write this.

    Cheers,
    Gokalp

  • Auto-formatting c++

    Locked
    3
    0 Votes
    3 Posts
    15k Views
    dailD

    I’ve also used CoolFormat which I don’t believe is available through the Plugin Manager. It has a really nice interface.

  • How to print notepad++ files from command line\ Batch script.

    6
    0 Votes
    6 Posts
    9k Views
    Claudia FrankC

    @Angelberry

    I’m sorry - my memory about this is wrong.
    Using google I found this which confirms your first syntax.

    Can you double check if you did the necessary steps described in the linked article?

    Cheers
    Claudia

  • Enable Lexer available in Scintilla

    8
    0 Votes
    8 Posts
    5k Views
    oirfeodent oirfeodentO

    @dail
    Thx for your response.

    @donho
    Is there a road map for such requests (Enabling Lexer which is available in Scintilla)?
    If not also, let us know what you think about it…
    If any help is required in organizing/executing such stuff as well… let us know.

    Thx in advance.

  • How can I install Notepad++ on linux?

    Locked
    2
    0 Votes
    2 Posts
    3k Views
    Claudia FrankC

    @Άγγελος-Ράπτης

    by using wine emulator.

    Cheers
    Claudia

  • Find in Files with multiple filters...

    Locked
    2
    0 Votes
    2 Posts
    4k Views
    Claudia FrankC

    @Daniel-Molendyke

    afaik, nothing. Should work as you’ve described.

    Cheers
    Claudia

  • please help, my computer Destroyed..

    6
    0 Votes
    6 Posts
    3k Views
    Claudia FrankC

    @vakil-lab

    check if you still have a file NppFTP.xml on your system.
    This is the file where username and password are stored.
    Depending of your npp configuration it must be copied
    to
    %APPDATA%\Notepad++\plugins\Config\NppFTP\NppFTP.xml
    or
    INSTALL_DIR\Notepad++\plugins\Config\NppFTP\NppFTP.xml

    If you still have access to the webserver from another machine,
    than you can snoop the network traffic with tools like wireshark,
    if you have used ftp protocol only, of course.

    Cheers
    Claudia

  • Update issue

    Locked
    2
    0 Votes
    2 Posts
    2k Views
  • Code Explorer

    10
    0 Votes
    10 Posts
    7k Views
    pnedevP

    @Massimo-Balestra,
    You could use SourceCookifier or TagsView plugin (search those in the Plugin Manager).
    BR

  • Output to Clipboard of "Count" function in search panel

    Locked
    12
    0 Votes
    12 Posts
    5k Views
    Claudia FrankC

    @Ed-Bernasconi

    Your welcome - good to see you have a workaround.

    Cheers
    Claudia

  • Please tell me how to fix it.

    Locked
    8
    0 Votes
    8 Posts
    4k Views
    Claudia FrankC

    @Hanul-Kim

    I can’t remember if this is normal or not and as I currently do not use
    a windows operating system I cannot test this.
    Do the files open with npp if you double click in explorer?
    If yes, everything seems to be ok.
    If not, give it a try to register extension by using right-click and check the box open always…

    In regards to the 32bit vs. 64bit npp version.
    You can use both versions even on a 64 bit Windows 7.
    Each version has its advantage and its disadvantage.

    Using the 64bit version eliminates the problem with file system redirection
    but disadvantage is that, currently, not many plugins are available.

    Using the 32bit version on a 64 bit operating system can cause problems
    if you want to open files which are available as 32bit and 64bit version.
    (https://msdn.microsoft.com/en-us/library/windows/desktop/aa384187(v=vs.85).aspx)
    Advantage, many many plugins which enhances npp functionality are available.

    So, if you do not use plugins - stay with the 64bit version.

    Cheers
    Claudia

  • Saving my search results ?

    Locked
    2
    0 Votes
    2 Posts
    3k Views
    Claudia FrankC

    @JP-Noreau

    Question: Why is their not the option of saving our search term results in Notepad ++ ?

    Simple answer, because it looks like there was no need to do so. Keep in mind that
    Notepad++ is mainly an programming editor and as such there is not really
    a need to save the search results often.

    In regards to your request, it is not clear to me what you want.
    Maybe you can clarify it by using examples, screenshots etc…

    Cheers
    Claudia

  • Caret not moving to end of blank line

    3
    0 Votes
    3 Posts
    2k Views
    AndrewA

    I just re-downloaded nppautoindent and the problem seems to be solved, so… sorry lol ^_^

  • How can I mark a column with the keyboard?

    Locked
    3
    0 Votes
    3 Posts
    5k Views
    Måns ThelanderM

    Thanks a lot. It´s working :-)