• Merging xml files

    2
    0 Votes
    2 Posts
    743 Views
    Alan KilbornA

    @Bela-Barton

    Unless there’s a way to do it with the XMLTools plugin (which I doubt), then this question is off-topic for this forum.

  • Color User defined global variable words e.g. TEST=

    7
    0 Votes
    7 Posts
    544 Views
    PeterJonesP

    @Christopher-Rotolo said in Color User defined global variable words e.g. TEST=:

    If I wanted to ‘request an update’ to the smalltalk language, any idea what is my best route

    The Lexilla project has an issues page, which is where official feature requests for the Smalltalk lexer would go.

    Again, given that they haven’t updated the Smalltalk lexer in 18 years, I am doubtful that they will add any new features to the lexer; but I have been wrong about such guesses before.

  • Regex: Delete group of many \\ on the same line

    3
    0 Votes
    3 Posts
    259 Views
    mkupperM

    @Hellena-Crainicu I suspect the reason your first expression did not work is that you may have Windows end-of-line with \r\n rather than the Unix style \n end-of-line that your expression expected. If you use \R then it will match any style of end of line. \R works with Windows, Unix, and Macintosh style end of lines which use \r.

    If you replaced the \n with \R we have \\\\u[0-9a-fA-F]{4}.*?\R{2,}

    That will match from the first \\uxxxx on to the end of the line followed by two or more end of line marks. The expression matches your example data if it’s followed by two or more blank lines.

    In your follow-up you used \\\\.*$ implying you had not intended to also include the end-of-line marks as part of the pattern nor the followed-by-blank-line requirement.

    This will work \\\\u[0-9a-fA-F]{4}.*$ though as you probably noticed, the data also includes \\ sequences such as \\n which is a newline plus some unusual things such as \\ n with a space between the \\ and n. The underlying HTML that this is intended to decode to is badly formatted meaning it’s likely not worthwhile to fully parse the data.

    Your \\\\.*$ just gets rid of it which is probably good.

  • Regex: Delete all the instances of <title> html tag, except the first one

    8
    0 Votes
    8 Posts
    373 Views
    mkupperM

    @Hellena-Crainicu I was puzzled by your comment. I suspect you were testing by having the expression you were testing with at the top of the file. In that case the first title was in the expression itself.

    I modified my search expression slightly to replace < with \x3c so that we can have the search/replace expression within the file for testing. I put it at the bottom in these examples.

    Here is the test I ran:

    Original data <p>但是减脂期可不一定就意味着每天只吃水煮鸡胸和水煮西蓝花,完全苦行僧一样的生活。如果在营养均衡的三餐之间适当的尝试一些健康的小零食,不仅能为减脂期提供动力和新鲜感,还可以为生活增添不少的趣味呢。</p>除此之外,从营养学角度,适当的加餐可以预防三餐之间出现低血糖的现象,还能防止因为饥饿而在下一餐中暴饮暴食,摄入过多热量的情况发生。</p>因此,健康的小零食不仅有助于完成减脂目标,还能让你的减肥期丰富多彩,何乐而不为呢?下面就来推荐给大家10种好吃又健康的小零食。</p> <title>用正确方式打开 MyGainer增健肌粉! - MYPROTEIN™</title> blah bhla blah bhla <title>Home is me</title> blah bhla <title>Payton is your name</title> Search: (?s)(\x3ctitle>.*?\x3c/title>.*?)\x3ctitle>.*?\x3c/title> Replace: $1

    ###First pass
    This is after doing search-replace-all one time. It removed the second title that was on line 5.

    <p>但是减脂期可不一定就意味着每天只吃水煮鸡胸和水煮西蓝花,完全苦行僧一样的生活。如果在营养均衡的三餐之间适当的尝试一些健康的小零食,不仅能为减脂期提供动力和新鲜感,还可以为生活增添不少的趣味呢。</p>除此之外,从营养学角度,适当的加餐可以预防三餐之间出现低血糖的现象,还能防止因为饥饿而在下一餐中暴饮暴食,摄入过多热量的情况发生。</p>因此,健康的小零食不仅有助于完成减脂目标,还能让你的减肥期丰富多彩,何乐而不为呢?下面就来推荐给大家10种好吃又健康的小零食。</p> <title>用正确方式打开 MyGainer增健肌粉! - MYPROTEIN™</title> blah bhla blah bhla blah bhla <title>Payton is your name</title> Search: (?s)(\x3ctitle>.*?\x3c/title>.*?)\x3ctitle>.*?\x3c/title> Replace: $1

    ###Second pass
    This is after doing search-replace-all twice. The first pass removed second title that was on line 5 and the second pass removed the third title that was on line 7.

    <p>但是减脂期可不一定就意味着每天只吃水煮鸡胸和水煮西蓝花,完全苦行僧一样的生活。如果在营养均衡的三餐之间适当的尝试一些健康的小零食,不仅能为减脂期提供动力和新鲜感,还可以为生活增添不少的趣味呢。</p>除此之外,从营养学角度,适当的加餐可以预防三餐之间出现低血糖的现象,还能防止因为饥饿而在下一餐中暴饮暴食,摄入过多热量的情况发生。</p>因此,健康的小零食不仅有助于完成减脂目标,还能让你的减肥期丰富多彩,何乐而不为呢?下面就来推荐给大家10种好吃又健康的小零食。</p> <title>用正确方式打开 MyGainer增健肌粉! - MYPROTEIN™</title> blah bhla blah bhla blah bhla Search: (?s)(\x3ctitle>.*?\x3c/title>.*?)\x3ctitle>.*?\x3c/title> Replace: $1

    If you watch the status line at the bottom of the search/replace box you will see:

    After pass 1: Replace All: 1 occurrence was replaced in entire file After pass 2: Replace All: 1 occurrence was replaced in entire file After pass 3: Replace All: 0 occurrences were replaced in entire file

    While your examples had the titles on their own lines I had coded to allow them to be anywhere in a line and for them to span lines as that’s what HTML allows. If you want to only support titles on a line by itself then we can add some anchoring:
    Search: (?s)^(\x3ctitle>.*?\x3c/title>\R.*?\R)\x3ctitle>.*?\x3c/title>$
    Replace: $1

    Even that is not perfect as it allows titles to span or more lines. If you insists on only matching titles on one line and not to span them then toggle the dot/EOL spanner flag:
    Search: ^(\x3ctitle>(?-s).*?\x3c/title>\R(?s).*?\R)\x3ctitle>(?-s).*?\x3c/title>$
    Replace: $1

    As you can see, the expression is getting more complicated to deal with the edge cases and requirements.

  • I needed a help in something

    10
    1 Votes
    10 Posts
    765 Views
    guy038G

    Hello, @mohammad-Al-Maaitah, @terry-r, @Peterjones and All,

    If we suppose that each line does NOT contain two or more colon chars ( : ), then the simple regex syntax, below, should be enough :

    SEARCH (?-s)^.{5,}:.*\R?

    REPLACE Leave EMPTY

    If several colon chars may exist in one line, we would have to distinguish between multiple cases ! But, this is on other story !

    Best Regards,

    guy038

  • Replace with - question for advance formating

    3
    1 Votes
    3 Posts
    207 Views
    D

    @Coises Thank you - it did the work perfectly!

  • How do I search for multiple names at once? Notebad++

    9
    1 Votes
    9 Posts
    723 Views
    mkupperM

    @sabry-farg
    Using regular expression mode you search for

    ahmed|saeed|emad|sameer

    The | symbol is usually on keyboards above the enter key. It’s known as vertical line, vertical bar, or pipe symbol. It has a rather long article on Wikipedia. https://en.wikipedia.org/wiki/Vertical_bar

    Nearly always we will see this in parentheses such as:

    (ahmed|saeed|emad|sameer)

    which then makes the name available when doing a search/replace using either \1 or $1

  • Duplicate Each Block of Lines Consecutively

    3
    2 Votes
    3 Posts
    1k Views
    M

    @PeterJones Thanks for the solution! I really appreciate that. So it turns out that I can use regex to do it. I’m embarassed that my regex skill hasn’t improved much. It seems to decline instead after long hiatus. If time allows, I want to relearn it so that I don’t have to keep asking here.

  • bypass admin

    2
    0 Votes
    2 Posts
    375 Views
    PeterJonesP

    @Benjamin-Zimmerman ,

    The portable edition, which can be unzipped and run into any directory where you have write permission, can be used with no admin access needed.

    But please note that I am not advocating violating your company’s IT policies: if you are not allowed to install or use software that hasn’t been approved by your IT department, then don’t.

  • Macros not saving

    13
    2 Votes
    13 Posts
    1k Views
    Robert RothR

    @mkupper Whelp, that fixed it. Once I replaced it with the former tmp, it worked just fine, and I’m able to modify macros.

    Still not quite sure why this was the case, but this definitely is a simpler test/fix than making a copy of the entire directory.

    Thanks, everyone, for the assistance.

  • Mark with same function jumping to row as Find?

    7
    0 Votes
    7 Posts
    440 Views
    Alan KilbornA

    @PeterJones said in Mark with same function jumping to row as Find?:

    But Mark with the ☑ Bookmark Line option turned on will also bookmark the lines, then F2 (Search > Bookmark > Next Bookmark) will navigate you through the bookmarked lines.

    I don’t know if this works well if there are already a smattering of bookmarks, and the newest text match can be anywhere in the file, i.e., OP wants to go to the specific text, which may not be the next bookmark…

    Or, even without Bookmark Line, after doing a normal Mark, you can use F3 (Search > Find Next) to navigate to the next match.

    Ah, yes, THAT may be the solution!

  • 1 Votes
    2 Posts
    173 Views
    mkupperM

    @Venugopal-MV said in I need to replace C: 0 d: 2 d: 1 with C: 0 d: 2 d: 2 in the below content wherein ""MicroSCADA DV DataSource" appears in the previous line.:

    I need to replace C: 0 d: 2 d: 1 with C: 0 d: 2 d: 2 in the below content wherein "“MicroSCADA DV DataSource”

    Try this using Regular Expression mode:
    Search: ^(C"MicroSCADA DV DataSource".+\R)C: +0 +d: +2 +d: +1
    Replace: $1C: 0 d: 2 d: 2

  • Notepad++ does not change after update

    3
    0 Votes
    3 Posts
    501 Views
    xomxX

    @AshutoshTiwari2017 said in Notepad++ does not change after update:

    Start-Process -FilePath “$env:TEMP$( Split-Path -Path $DownloadUrl -Leaf )” -ArgumentList “/S” -Wait

    As you are using the silent N++ installation, it could be connected to:
    https://github.com/notepad-plus-plus/notepad-plus-plus/issues/10189

    v8.6+ installers contain a fix for such partial incomplete installations:
    https://github.com/notepad-plus-plus/notepad-plus-plus/commit/5c80be7667eb84f0345ef827cab030724c2e13c6

    But still - the N++ cannot be silently installed/upgraded when an instance of N++ is running. To allow this a new installer switch “/closeRunningNpp” needs to be implemented for the silent installations.

  • How to edit and save my theme?

    2
    1 Votes
    2 Posts
    14k Views
    PeterJonesP

    @Martin-Vlach ,

    Copy themes\original.xml to themes\your.xml , and change the name inside the XML to Your Theme Name Open Notepad++ Settings > Style Configurator > Select Theme: Your Theme Name Use Style Configurator to edit your theme When you exit Notepad++, it will save your theme

    You would then save a copy of themes\your.xml and then put it on any new computer / new installation where you want that theme.

    (Clarification: original.xml, your.xml and Your Theme Name are intended as placeholders: use reasonable values, not literally what I put.)

  • Bug report: Indented and aligned carriage return not working

    13
    0 Votes
    13 Posts
    862 Views
    MattexDM

    @PeterJones That check auto-indent was disabled, the problem is solved. Thank you so much for your help and your patience

  • disable highlighting of code blocks

    8
    1 Votes
    8 Posts
    1k Views
    MattexDM

    @Lycan-Thrope I know but I use it momentarily to simulate a written exam I have to take

  • An application suddenly stopped processing a Notepad++ text file

    9
    1 Votes
    9 Posts
    739 Views
    Alan KilbornA

    @mkupper said in An application suddenly stopped processing a Notepad++ text file:

    I accidentally pressed some combination of buttons that converted one of the spaces into some kind of special space - longer than usual. I don’t know what exactly that was, but it was quite invisible between the lines, and I only discovered it by moving the cursor up by hand.

    It’s a pity you don’t have more exact information about this, because I’m fairly certain you can’t get a “special space” in this way (although @Coises recently pointed out some non-English keyboard where a special keycombo involving the spacebar inserts a “special space” – so maybe that’s it? – see HERE).

    Notepad++'s default settings, shown here:

    5bf0ce67-de69-423e-944b-dcd843311242-image.png

    should show you if you get any kind of “special character” inserted into your document. The effect would be very obvious, e.g. see ZWNJ character in the sample below:

    0f1f6410-f8fa-4db7-b4b3-05d55bf35655-image.png

    Notepad++ needs to have some warning system for these types of very casual replacements. I probably held down Shift or Control or Alt, and voila. Maybe a beep?

    I think the visual effect is enough. There shouldn’t be any other sort of “casual replacement” – if you think there is, please provide further detail.

  • Help finding search results panel

    5
    1 Votes
    5 Posts
    364 Views
  • Multi-edit

    8
    1 Votes
    8 Posts
    2k Views
    PeterJonesP

    @Alan-Kilborn said in Multi-edit:

    No one would actually use these commands from the menus.

    I cannot remember any more keystrokes, so I’m not likely to assign a keyboard shortcut. Instead, if I find myself wanting to use the new features, I’ll probably add them to the contextMenu.xml, so they’re just a local right-click away.

    … But yes, if I do end up using them often, it will need to be easier access than having to move my mouse cursor up to the main menu system.

  • how to change first letter after colon uppercase?

    2
    1 Votes
    2 Posts
    179 Views
    guy038G

    Hello, @glo and All,

    Not difficult with regular expressions !

    SEARCH (?<=:)\w

    REPLACE \u$0

    Radio button Regular expression set

    Click on the Replace All button

    Best Regards,

    guy038