• 0 Votes
    2 Posts
    856 Views
    PeterJonesP

    @Clayton-Moudy ,

    It’s going to be hard for us to debug, given the few details you’ve given. The more you can tell us, the easier it is for us to help you.

    I’ve had to guess at your input file. (In this forum when you post, you can just prefix four more spaces on the quoted material, and the forum will properly mark it as preformatted code, so it’s easily set apart. I also included a comment-line… and will possibly need a first line that doesn’t indent)

    # comment-line with no extra spaces to align forum formatting two) spaces three spaces) four spaces five spaces no spaces one space two spaces) three spaces four spaces five # blank line to align forum formatting

    Other than the # lines, is that an accurate representation of your file?

    What is the difference between the two computers? Could you grab the ? > Debug Info > copy for each computer’s Notepad++, and paste in a reply – and mark which one does it right, and which does it wrong? What other settings are different between the NPP installations on each?

  • 0 Votes
    4 Posts
    2k Views
  • 7.5.4 64 bit no plugin manager

    5
    0 Votes
    5 Posts
    23k Views
    MatthewMcDM

    Resolved this on a new machine by installing 7.4.2 (https://notepad-plus-plus.org/download/v7.4.2.html) and then let the upgrader do it’s job.

  • edit m3u iptv list file - hide line number in results

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Claudia FrankC

    @SiberMedya

    I assume you want to copy the result without the line numbers, correct?
    If so, right-click into the result window, select all and copy
    and paste in a new document.
    Even it looks like you copy everything, it copies only the found items.

    Cheers
    Claudia

  • 0 Votes
    2 Posts
    1k Views
    MAPJe71M

    (?s)(?<=Address\x20).*(?=\x20Property\x20Type)

  • [Regex] Rounding numbers

    Locked
    6
    0 Votes
    6 Posts
    8k Views
    guy038G

    Hello, @david-wanke, @perterjones and All,

    David, I saw your post yesterday but I hadn’t time to reply, because I’ve just thought about some rounding cases, shown by Peter !

    Of course, with a regex, no problem to change, for instance :

    The floating number 12.45678 into the number 12.457

    And the floating number 12.45623 into the number 12.456

    using the rules :

    If the fourth decimal digit, after the decimal point, is between 0 and 4, just truncate all decimal digits after the third one

    If the fourth decimal digit, after the decimal point, is between 5 and 9, increase by one the third digit and truncate all decimal digits after the third one

    But, as regular expressions, mainly, do string operations, I would have, given the second rule, to take in account all values of the third decimal digit : if 3 then replace by 4, if 7 then replace by 8 and so on… ! And what about rounding 12.99962 which should give 13.000 !

    So, it’s easy to understand that the rounding process is, fundamentally, a mathematical operation, which is usually handled by programming or script languages. For instance, in the Peter’s Python script, the line, below, does the mathematical operation ( I’m not a python expert but I don’t think I’m wrong about it !! )

    while start < end: .... rounded = round( float(text) , 3 ) ....

    As Peter said, this an example of the limitations of regular languages ;-))

    Best Regards,

    guy038

    P.S. :

    Refer to some Wiki documentation, below :

    https://en.wikipedia.org/wiki/Regular_expression

    https://en.wikipedia.org/wiki/Regular_language

    Just note that I did not understand most of the second article, anyway ! But, it’s good, from time to time, to feel oneself, very intelligent… during some seconds ;-))

  • 1 Votes
    5 Posts
    2k Views
    Norbert QuastN

    @Scott-Sumner said:

    Favorites.dat is used by the Explorer plugin…and Claudia’s proposed technique should work just fine for it as well.

    Thank

  • Ctrl + Backspace

    Locked
    6
    0 Votes
    6 Posts
    3k Views
    Claudia FrankC

    @Gaurav99

    by any chance to you mind uploading the erroneous config.xml to some place
    where I can download it? I’m just curious what could have caused this.

    Cheers
    Claudia

  • Always opens As Administrator

    Locked
    2
    0 Votes
    2 Posts
    7k Views
    Claudia FrankC

    @Curtis-Krajca

    wasn’t there such option if you right-cklick on npp shortcut and open settings/properties or so?
    If not, delete the shortcut and create a new one.

    Cheers
    Claudia

  • Is it possible to disable the "Delete from Disk" option from Menu "File".

    Locked
    2
    1 Votes
    2 Posts
    1k Views
    Claudia FrankC

    @Veera-Kotnala

    not really but newer version will move it to recycle bin.

    Cheers
    Claudia

  • Remove duplicate strings with comma separator

    Locked
    4
    0 Votes
    4 Posts
    3k Views
    Saki SoulimenasS

    OK, Problem solved… i needed to wake up first. :)
    I’ll use your comma replacer first and then i can remove duplicate lines.

    Perfect! Thank you very much.
    Have a nice day

  • Mobile\Cloud Usage

    Locked
    2
    0 Votes
    2 Posts
    949 Views
    Claudia FrankC

    @Carl-Fuess

    I assume you are looking for File->SaveSession and File->LoadSession.

    Cheers
    Claudia

  • Marking lines immediatelly after marked lines

    Locked
    3
    0 Votes
    3 Posts
    5k Views
    Mortaza AziziM

    Hello @guy038
    Thanks for your comprehensive reply to my question.

  • UDL for .properties files.

    Locked
    2
    0 Votes
    2 Posts
    969 Views
    Jim DaileyJ

    @Baneeishaque
    Try the Language–>Define your language … menu entry.

  • How can i paste something on lines without making new ones?

    Locked
    1
    0 Votes
    1 Posts
    734 Views
    No one has replied
  • [Regex] Remove all but last line

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    Bobby Peters222B

    Thanks guy038 your second one worked perfectly for me. Really appreciate it.

  • Setting a Column to a fixed value in a text file

    4
    0 Votes
    4 Posts
    3k Views
    guy038G

    Hello @chuck-ballinger,

    An other possibility is to use regular expressions !

    Let’s suppose that you want to insert a X character, in column n, on any line of your file :

    Open the Replace dialog ( Ctrl + H )

    OPTIONS Wrap around and Regular expression checked

    SEARCH (?-s)^.{n-1}\K\x20+(?=(X))|^.{0,n-1}\K ( Replace the expression n-1 with the appropriate number ! )

    REPLACE ?1:n spacesX

    ACTION click TWICE on the Replace All button

    So, assuming the initial text, below, with a first blank line :

    1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012 1234567890123 12345678901234 123456789012345

    After two click on Replace All, we get the text :

    X 1 X 12 X 123 X 1234 X 12345 X 123456 X 1234567 X 12345678 X 123456789X 123456789X0 123456789X01 123456789X012 123456789X0123 123456789X01234 123456789X012345

    If you like that solution, I’ll give you, next time, some details on that regex S/R !

    Best Regards,

    guy038

  • Regex: Remove particular words from tags in several text pages

    12
    0 Votes
    12 Posts
    6k Views
    guy038G

    Hello, @vasile-Caraus and All,

    The general syntax of your regex is :

    SEARCH (?-s)(\G|BR)((?!ER).)*?\KSR

    REPLACE RR

    where :

    BR ( Begining Regex ) is the regex which defines the start of the defined zone, for search/replacement

    ER ( Ending Regex ) is the regex which defines the end of the defined zone, for search/replacement

    SR ( Search Regex ) is the regex which defines the regex to search, in any defined zone

    RR ( Replace Regex ) is the regex which defines the regex replacing the search regex, in any defined zone

    For instance, before the S/R, if we have :

    ..SR.....SR...BR......SR............SR.....ER...SR......SR...BR.......SR........ER....BR..SR......SR.....SR...ER....SR......SR..

    it will give the results :

    ..SR.....SR...BR......RR............RR.....ER...SR......SR...BR.......RR........ER....BR..RR......RR.....RR...ER....SR......SR..

    Of course, in the Vasile’s example, we have :

    BR = <p class="my_class">

    ER = </p>

    SR = &nbsp;

    RR = \x20

    But, let’s suppose that we take :

    BR = [01234]+

    ER = [56789]+

    SR = (?i)[a-z]+

    RR = |$0|

    So, assuming the text :

    ..SR.......SR....BR....SR....SR.......ER...SR........SR.....BR....SR.....ER..BR....SR......SR.....SR......ER....SR......SR....... ..Here.....is....111...a.....Simple...6....Example...of.....44....some...9999000...TEXT....to.....Search..7.....and.....Modify...

    and the transformed regex S/R :

    SEARCH (?-s)(\G|[01234]+)((?![56789]+).)*?\K(?i)[a-z]+

    REPLACE |$0|

    it would produce, as expected, the text :

    ..SR.......SR....BR....RR......RR.........ER...SR........SR.....BR....RR.......ER..BR....RR........RR.......RR........ER....SR......SR....... ..Here.....is....111...|a|.....|Simple|...6....Example...of.....44....|some|...9999000...|TEXT|....|to|.....|Search|..7.....and.....Modify...

    Cheers,

    guy038

  • 0 Votes
    3 Posts
    1k Views
    Chip CooperC

    What you’re describing is very common in OOP languages. If this behaved like they do, one would be looking for something more like a doEvents operation as sleep usually halts all operations in the background, unless the community started incorporating a doEvents equivalent into a sleep command (which IMO should have been done years ago, if not already done). In fact I wonder if this is a python background issue rather than a regex issue.

    I’m just starting into regex and have started thinking along similar lines to what you mention here; I’m interested in seeing what others can add to this question by way of responses. Perhaps you could insert timestamps in a test document?

  • Looking for definitive RegEx reference to learn SciLexer.dll RegEx

    Locked
    5
    0 Votes
    5 Posts
    2k Views
    Chip CooperC

    Thank you so much for the quick reply! I appreciate that, as I had really started to get into that Wiki page. So, I’ll just go ahead and work on using that information, and see where it leads me. But, snippets are welcome. They’re great samples; Scott, Guy and others do such a great job of explaining what they’ve written.