• Multiple language styles in single document

    Locked
    1
    0 Votes
    1 Posts
    966 Views
    No one has replied
  • Find unique characters / lines

    Locked
    2
    1 Votes
    2 Posts
    7k Views
    guy038G

    Hello, @カヒノビチアレクセイ

    Not very difficult, indeed !

    If you don’t mind about a final sort of your unique CJK characters, here is a way to achieve it, very quickly :-))

    First of all, just backup your original list ( A safe behaviour to adopt, in any case ! )

    Now, let suppose you have the following list of CJK characters. I just added, after a space, the Unicode code-point of each character

    丰 4E30 不 4E0D 丆 4E06 与 4E0E 不 4E0D 丰 4E30 且 4E14 世 4E16 中 4E2D 且 4E14 与 4E0E 丰 4E30 丟 4E1F 中 4E2D 与 4E0E 中 4E2D 丆 4E06 丰 4E30

    First, perform a classical sort, with the menu option Edit > Line Operations > Sort lines Lexicographically Ascending. We get, immediately, the sorted text, below :

    丆 4E06 丆 4E06 不 4E0D 不 4E0D 与 4E0E 与 4E0E 与 4E0E 且 4E14 且 4E14 世 4E16 丟 4E1F 中 4E2D 中 4E2D 中 4E2D 丰 4E30 丰 4E30 丰 4E30 丰 4E30

    Now :

    Move back to the very beginning of your file ( Ctrl + Origin )

    Open the Replace dialog ( Ctrl + H )

    In the Find what: zone, paste or type the regex (?-s)^(.+\R)\1+

    Leave the Replace with: zone EMPTY

    Select the Regular expression search mode

    Click on the Replace All button

    => You should get, only, the two lines, below :

    世 4E16 丟 4E1F

    Et voilà !! It just remains the two unique characters of the original list :-))

    Notes :

    The first part (?-s) is a modifier which implies that any dot will match a single standard character and not EOL characters

    Then, the ^ symbol is a zero-length assertion, which means beginning of line

    Now, the part (.+\R) represents a non-empty range of consecutive standard characters, followed by its EOL character(s). As the current complete line is enclosed in parentheses, it’s stored as group 1

    Finally, the part \1+, is a repeated back-reference to group 1, which looks for any non-empty range of consecutive lines, identical to the first one !

    As the replacement zone is EMPTY, all these repeated lines ( > 1 ) are simply deleted !

    Best Regards,

    guy038

  • Replace different values with one value

    Locked
    2
    0 Votes
    2 Posts
    6k Views
    guy038G

    Hello, @Covertraptor90,

    Very easy, Indeed !

    Move to the very beginning of your file ( Ctrl + Origin )

    Open the Replace dialog ( Ctrl + H )

    Paste or type the following regex search <drivingSkill>\d\.\d+</drivingSkill>, in the Find what: zone

    Paste or type the following replacement text <drivingSkill>1</drivingSkill>, in the Replace with: zone

    Select the Regular expression search mode

    Click on the Replace All button

    Et voilà !

    Notes :

    The syntax \d matches any single digit, from 0 to 9

    The escaped dot \. stands for the decimal dot character. It must be escaped because dot is, normally, a special regex character !

    The syntax \d+, identical to \d{1,}, matches any non empty range of consecutive digits

    Everything else is just text, which matches itself, in, both, search and replacement !

    Best Regards,

    guy038

  • Convertot Plugin upgrade always fails validation

    Locked
    1
    0 Votes
    1 Posts
    902 Views
    No one has replied
  • How to deal with "" tags

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Remove/Replace specific character from specific location

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Tobias IsakssonT

    Solved

    once i figured out that ^ and $ marks start/end it was easy :)

    New to this, dont judge me haha

  • Case sensitive fix.

    6
    0 Votes
    6 Posts
    5k Views
    dynamitttD

    Thank you!

  • Style colouring/coloring issues

    6
    0 Votes
    6 Posts
    4k Views
    Claudia FrankC

    @Wayne-Ivory

    Hi Wayne,

    Out of interest I compared the before-and-after config.xml files but didn’t see any differences

    it could be any of the xml files. If you still have the files and you are interested to find out which
    one and what caused the issue you need to compare them all but good to see that it is working
    again.

    Cheers
    Claudia

  • write in column mode add spaces for indention, instead of tabs

    3
    0 Votes
    3 Posts
    3k Views
    MaDillM

    Then let’s hope that N++ update Scintilla some day…

  • Run Command Variable Substitution $(FULL_CURRENT_PATH)

    8
    0 Votes
    8 Posts
    10k Views
    Ray HaynesR

    Just in case anyone stumbles across this thread in the future there is a little detail about quotes. If you have spaces in your path you must put quotes around the $(FULL_CURRENT_PATH) variable, i.e. “$(FULL_CURRENT_PATH)”. The lack of quotes was complicating my trials above and I had some new issues today that were caused by the lack of quotes.

  • Pythonscript maximum menu items

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    @Alan-Kilborn

    Hi Alan, I assume that 50 is just an arbitrary number, wasn’t able to find any msdn
    document which states that this is a limit.

    Can’t say anything about python script future plans, unfortunately.

    Cheers
    Claudia

  • How do i delete everything except the square brackets

    Locked
    5
    0 Votes
    5 Posts
    3k Views
    Claudia FrankC

    @moon6969

    Hi, nice one but I guess there is little issue as you use

    [^\[\]]

    whereas, I believe, it should be

    [^\[]

    because otherwise a text like

    blabla] blabla [needed_text] blabala

    will break your logic.

    Cheers
    Claudia

  • CR line terminators are pasting as CRLF

    Locked
    4
    0 Votes
    4 Posts
    4k Views
    dailD

    I do agree this is usually the desired behavior. I often copy/paste from various sources and would hate to have all the line endings mixed up.

    That said, there is a way to turn it off. You’d need to install a plugin such as LuaScript or PythonScript so that you can call SCI_SETPASTECONVERTENDINGS and set it tofalse.

  • Removing variable text

    Locked
    1
    0 Votes
    1 Posts
    990 Views
    No one has replied
  • Issue opening directory in FTP

    Locked
    2
    1 Votes
    2 Posts
    2k Views
    Lucas LomanL

    Also, after several minutes, I receive the message:
    “Failure retrieving contents of directory /”

  • Pc won't boot.

    Locked
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Read-only does *NOT* work.

    Locked
    4
    0 Votes
    4 Posts
    2k Views
    Claudia FrankC

    @Martin-Bedan

    removing the read-only flag doesn’t change the content of a file but
    of course makes a process able to do changes again so it might be that
    some queued changes do get flushed as soon as the process determines that it can
    write to the file. But this is not the behavior of npp.

    Cheers
    Claudia

  • Hello, again. Back a little quicker then expected lol

    Locked
    1
    0 Votes
    1 Posts
    951 Views
    No one has replied
  • How find range of lines by their number?

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Scott SumnerS

    @Obada-Kurdi

    Okay, so technically it isn’t possible to directly say “Replace lines X through Y” with something else. That being said, there are some ways to achieve the goal.

    In your specific case, with X=1 and Y=189, it becomes fairly easy:

    Step 1: Move your caret to the very top of your file (important)

    Step 2: Execute the following “Replace” operation (not “Replace All”!):

    Find-what: (?-s)(.*\R){189} Replace-with: whatever you want Search-mode: Regular expression

    However, in the general case (where the starting line X is NOT equal to 1), things are more interesting/tricky. Here’s a solution for that general case, unfortunately it requires you to do some mental math:

    Step 1: Move your caret to the very top of your file (important)

    Step 2: Execute the following “Replace” operation (not “Replace All”!):

    Find-what: (?-s)(.*\R){S}\K(.*\R){L} Replace-with: whatever you want Search-mode: Regular expression

    where:

    S is the one less than the desired starting line number, note S = X - 1 L is the number of lines it is desired to replace, note L = Y - X + 1

    because (from the problem statement):

    X is the FIRST line to replace with other data Y is the LAST line to replace with other data

    This technically isn’t a Notepad++ question, but more of a Boost regular expression engine question, so I’m reluctant to put forward this solution here, due to less tolerance lately for non-Notepad++ discussion. However, this does have an important N++ implication regarding where the caret is when the replacement is conducted.

    If this (or ANY posting on the Notepad++ Community site) is useful, don’t reply with a “thanks”, simply up-vote ( click the ^ in the ^ 0 v area on the right ).

  • application error

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Claudia FrankC

    @Мария-Денисова

    does this happen when you use no plugins also? You can start npp with -noPlugin switch
    or by renaming plugins directory temporarily.

    Cheers
    Claudia