• selecting text using find with regular expression

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Zs LZ

    Thank you very much! I have to use the assertions in the regular expression as you did.

  • Find in Files (avoid) Filter

    Locked
    2
    0 Votes
    2 Posts
    4k Views
    Claudia FrankC

    Hello Maheedharan-Rengarajan,

    afaik there is exclude filter but what you can do is to use multiple extension at once
    like

    *.h *.cpp *.c

    Maybe this is another way to do it?

    Cheers
    Claudia

  • need help please

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    dailD

    No idea what kind of file that is but it looks like it isn’t meant to be edited with a text editor.

  • unix perl script problem...

    Locked
    6
    0 Votes
    6 Posts
    4k Views
    Robert S. IrrgangR

    Ok, thank you! I try it!

  • Language-MS ini missing.

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    Hello Tauriq-Esack,

    not sure if it was called MS INI before but right now I do have an INI language (under letter I)
    Is this be different to MS INI?

    Cheers
    Claudia

  • Bookmark image in source files

    Locked
    5
    0 Votes
    5 Posts
    3k Views
    YaronY

    Hi Claudia,

    That’s great.
    Thanks again. I appreciate your kindness.

    Regards.

  • Change End Of Line

    8
    0 Votes
    8 Posts
    6k Views
    Claudia FrankC

    Hello Bonnie,

    thank you and a happy new year to you as well.

    Cheers
    Claudia

  • fail to import xml langage

    Locked
    3
    0 Votes
    3 Posts
    6k Views
    barbuxB

    hi,
    i didn’t download the file properly (not the raw file).
    thank you for help and my best wishes for this new year.

  • Perl foldable text block

    Locked
    4
    0 Votes
    4 Posts
    3k Views
    Claudia FrankC

    Hello Yves,

    one word of warning. Avoid using nested hides, this might confuse npp.
    Meaning, dont hide lines 2-12 if you hided lines 4-8 already.

    IMHO, language settings should be editable. All the basis is there to augment folding.

    I agree, for builtin languages we don’t have much possibility to add additional
    features or change the behaviour of the lexer. Most of it is done under the hood
    by the scintilla component. The big advantage so is speed and we don’t
    have to struggle with the lexer, which can be a pain in the …

    Cheers
    Claudia

  • multiple function types in functionList

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Kevin CryanK

    Thanks. I will give it try.

  • What standard for Regular Expressions is Notepad++ using?

    Locked
    5
    0 Votes
    5 Posts
    6k Views
    Tony De GrootT

    Hi guy038,

    I had used part of your first example - I used search for ^“”, but missed the rest of the line. Using the complete expression worked fine.

    Many thanks,

    Tony

  • dumb question, save as .csv

    Locked
    2
    0 Votes
    2 Posts
    9k Views
    Claudia FrankC

    Hello David-Bandey,

    csv stands for comma separated values but one must define
    where to put the commas, so there is no conversion possible
    without defining rules where to put the comma.

    Assuming there is a text like

    Do the right thing. It will gratify some people and astonish the rest.

    You can, for example, decide to split the text into

    Do the right thing.

    and

    It will gratify some people and astonish the rest.

    then you would put the comma after the first sentence but you can
    also decide to split it in three parts then you might possibly choose

    Do the right thing. It will gratify some people and astonish the rest.

    which would mean you have to set the first comma after the first sentence
    and the second comma after the word people.

    So you see there isn’t a one and only way to do this.
    If you can provide as a sample text then we might be able to offer
    some possible solutions.

    Cheers
    Claudia

  • Find in files returns 0 results

    Locked
    2
    0 Votes
    2 Posts
    3k Views
    Claudia FrankC

    Hello Aled-Powell,

    one of the error sources could be permission problems. You use a non-priviledged account
    where as files stored in the directory belong to administrator only. Or someone set the permission
    that no one is allowed to read the files at all.
    Another possible issue could be that the directory isn’t really a directory but a hard/soft link or even worse
    a network link to an unknown formatted source. You think I’m jokeing, I went through all of this.
    And one of the most common problem when using npp and windows 10 together is/was that
    there are problems when starting npp in adminstrative mode. Now that I wrote this last sentence I
    reckon’ that I should have started with it. So please double check shortcut properties->compatibility.

    Cheers
    Claudia

  • Smart HighLighting for multiple view !

    9
    0 Votes
    9 Posts
    8k Views
    Claudia FrankC

    So let’s summarize.
    The script worked before but not as expected
    because the original version matched only whole words
    and not if the searched word is part of another word.

    To change this I changed

    editor.research('\\b{0}\\b'.format(selected_text), lambda m: matches.append(m.span(0)))

    to

    editor.research('{0}'.format(selected_text), lambda m: matches.append(m.span(0)))

    then I thought maybe there can be also a difference in notation
    therefore I included regex module

    import re

    and added the ignorecase flag to the research function.

    editor.research('{0}'.format(selected_text), lambda m: matches.append(m.span(0)),re.IGNORECASE)

    Which broke not only your uploaded code, which by the way is working for me,
    but also the python script plugin??

    This is weird. There is nothing fancy here. re module is part of the standard python lib.

    OK, please comment the import re line

    # import re

    and change the editor.research … to

    editor.research('{0}'.format(selected_text), lambda m: matches.append(m.span(0)))

    and do another test.

    You do not need to do anything in the python script console, just open it, it serves as an
    error output window if something within the python code is wrong.
    For example if you add the re.IGNORECASE flag but you do not import re module first
    the error would be shown in the console window as soon as you double click on a word.

    Traceback (most recent call last): File "...\Notepad++\plugins\Config\PythonScript\scripts\Highlight.py", line 42, in sci_callback_DOUBLECLICK colorize() File "...\Notepad++\plugins\Config\PythonScript\scripts\Highlight.py", line 29, in colorize editor.research('{0}'.format(selected_text), lambda m: matches.append(m.span(0)),re.IGNORECASE) NameError: global name 're' is not defined

    May I ask you which OS, npp and python script plugin version you use?

    Cheers
    Claudia

  • How to remark out a line

    Locked
    3
    0 Votes
    3 Posts
    3k Views
    Arizona WillieA

    Thanks for the rapid reply. :)

    This is a game .ini file for Fallout 4.

    I followed your recommendation and will try it in a few minutes.

    Thank you very much.

    Well it seems to work. Game runs with no problem with the item remarked out.

    So unless I run into problems I will leave it that way.

    Thanks again.

  • Insert / Move XML Rows

    Locked
    8
    0 Votes
    8 Posts
    7k Views
    Claudia FrankC

    Hello Juan,

    could it be that the xml is layout more like

    <App action='A' id='1378'> <BaseVehicle id='128520'/> <SubModel id='3043'/> <EngineBase id='2133'/> <Qty>1</Qty> <PartType id='6708'/> <Part>G600096</Part> </App> <App action='A' id='1379'> <BaseVehicle id='128520'/> <SubModel id='296'/> <EngineBase id='2133'/> <Qty>1</Qty> <PartType id='6708'/> <Part>G600096</Part> <Note>W/O TOC ATTACHED<Note/> </App>

    if so, I didn’t take care that Note node may start with spaces in front.
    The find regex needs to be changed like

    (.*Qty>1<\/Qty>)\R(.*)\R(.*)\R(.*Note>.*\/>)

    Cheers
    Claudia
    P.S. I tried to modify guy038’s regex but didn’t get it done :-(
    but I learned and replace \r\n with \R :-)

  • Save as .txt default

    5
    0 Votes
    5 Posts
    6k Views
    Claudia FrankC

    Hello,
    did a quick check, opened a new document, chose save as
    and got .txt as the default extension. So looks ok for me.
    Win7 x64 npp6.8.8

    Cheers
    Claudia

  • find and replace help

    Locked
    5
    0 Votes
    5 Posts
    8k Views
    guy038G

    Hi Claudia,

    No, It’s not related to the complexity of the regex ! It’s just that the step-by-step replace doesn’t work at all, as soon as the search regex contains, at least, one \K form :-(( Though I don’t know exactly why !?

    Consider the subject string below :

    abc abcdef abcdefghi abcdefghidefjkl

    With the simple S/R SEARCH abc\Kdef and REPLACE 123, if I click on the Replace All button, we get the right text :

    abc abc123 abc123ghi abc123ghidefjkl

    Note that the second string def has not been changed, because it wasn’t just after an abc string. That’s correct !

    On the contrary, if I click, several times on the Replace button, nothing has changed !!!

    Cheers,

    guy038

    P.S.:

    I’ve just realized that the bug exists too, if we use a look-behind, instead of the \K form !

    So, the S/R SEARCH (?<=abc)def and REPLACE 123 does the job, if you click on the Replace All button, ONLY !

    Remember that, due to the look-behind feature, this regex tries to match a def string, only if preceded by the string abc

  • Can NPP have tripple views?

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    dailD

    3 views is not possible. Only 2.

  • How do I edit x64 bit files on file system?

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    Hello Greg,

    may I ask you which version of npp you are using as this issue
    should have been solved already. Some 5.8… version if I remember correctly.
    In the meantime I edited hosts file on a windows7 x64 pc with npp 6.8.7
    and do not have the problem you described.

    Cheers
    Claudia