• Exact search instead of «fuzzy search»

    2
    0 Votes
    2 Posts
    360 Views
    dinkumoilD

    @Christof-Rimle

    This is a frequently upcoming issue, for example see >> my comment in another thread <<.

    You should not expect that this behaviour will change in the future as it derives from Scintilla, the underlying edit component Notepad++ uses, which in turn applies an algorithm called Case Folding that is part of the Unicode standard when it performs a case insensitive search operation.

    The only way to get “exact” search results like you want them is to use case sensitive search (check option “Groß-/Kleinschreibung beachten”) because this prevents Scintilla from applying Case Folding.

  • Regex - fiename as parameter in search replace

    3
    0 Votes
    3 Posts
    195 Views
    Terry RT

    @RaniRani said in Regex - fiename as parameter in search replace:

    How do I do fetch the filename using regex across all site?

    I’m not sure I fully understand what you want to do however I provided a solution in this post which dealt with getting the filename of each opened file in Notepad++, saving it within the file and closing the file.

    Then a regex was used to update each file by copying that filename to selected (actually all) lines within the file. As @Alan-Kilborn stated the filename isn’t available to regex as a variable you can call on, but my first step was just a macro recording the use of menu options which then allowed a regex to complete the process.

    So take a look and see if maybe it might help. Reply back to this post if you think this can help you and you need a bit of extra help.

    I’m not on a PC currently otherwise I might have provided some more details.

    Terry

  • Regex: Find and Delete duplicate apostrophe on a html tag

    10
    0 Votes
    10 Posts
    706 Views
    Robin CruiseR

    super answer, @guy038 Thanks

  • Associate Notepad++ with .txt .log etc

    5
    1 Votes
    5 Posts
    3k Views
    Mick DawdyM

    I missed one of the options. I should have waited a day, settled down, and went at it again. Anyway, all’s good now. Thank you for the patient help :)

  • Reorder XML with Python script

    2
    0 Votes
    2 Posts
    224 Views
    EkopalypseE

    @Mark-McCall

    may I ask you what exactly you are trying to solve?
    Is it about being sure to always have a standardized xml file?
    If so, have you considered using xslt instead?
    Or do you need a generic way to reorder the tags based on your current requirements?

  • Highlighting characters based on character count

    2
    1 Votes
    2 Posts
    471 Views
    Alan KilbornA

    @Ken-aRf

    While it doesn’t highlight the character itself, I would suggest using the vertical edge feature:

    5772c6e2-7374-4588-a0bb-30035efab919-image.png

    This forms a nice “bracketing” of the columns you are interested in.

  • Plugins and Plugins Admin panel gone after update to 7.9.5

    2
    0 Votes
    2 Posts
    5k Views
    PeterJonesP

    @Ignus666 ,

    As always, showing your ?-menu Debug Info will help.

    I am assuming you used the “installer” rather than the “portable”. If this is wrong, this advice won’t work exactly as written.

    The Plugins Admin tool does ship with Notepad++ v7.9.5, so something went wrong with your installation.

    I don’t know why it wouldn’t have been installed properly, but the only way I could reproduce your problem was to get rid of the <installdir>\Plugins\Config\nppPluginList.dll (or more drastically, remove its whole containing folder – probably c:\Program Files\Notepad++\Plugins\Config\nppPluginList.dll, but it depends on 32/64-bit and whether you changed the default location.)

    If you use the normal installer, I think the easiest way to get it back would be to re-install. Make sure you get the installer from the official https://notepad-plus-plus.org/downloads/v7.9.5/ location – do not trust whatever downloader you currently have, because it messed up.

    If reinstalling from the official installer doesn’t work, the ?-menu Debug Info will give you the path for the Notepad++ executable. Go into its folder. Make sure plugins exists; make sure plugins\Config exists. If so, then download the appropriate portable version (either 32bit or 64bit, to match your normal installer bit-value), and unzip the nppPluginList.dll into the location mentioned earlier.

  • Left Gutter / Space at the begginning of a line / SCI code 2155

    7
    0 Votes
    7 Posts
    595 Views
    Adam WestA

    @PeterJones
    @Alan-Kilborn
    @dinkumoil

    Thank you all for the very detailed information and explanation of why it doesn’t work anymore. I wasn’t expecting so much.
    np++ is the best editor I’ve used in my 20 years as a PeopleSoft developer. I look forward to the left-padding setting, but will give startup.py a shot for now.
    -Adam

  • How can I change all the words in a given structure?

    29
    0 Votes
    29 Posts
    2k Views
    guy038G

    Hello, @darkenb, @alan-kilborn, @peterjones, @ekopalypse and All,

    @darkenb :

    Regarding the B and D regex S/R, note that I didn’t explain fully how they work. I do think that you need to learn basic regex concepts first, before trying to understand these complicated syntaxes which would just confuse you ;-)

    To All,

    Regarding the A and C regex S/R, they can be simplified and we do not need to use conditional regexes ! Indeed :

    Regex S/R A :

    SEARCH (\x5b)|(\x5d)

    REPLACE \1_\2

    Regex S/R C :

    SEARCH (\x5b)_|_(\x5d)

    REPLACE \1\2

    As you can see, the opening square bracket \x5b is stored as group 1 and the ending square bracket \x5d is stored as group 2. And, as the two alternatives are mutually exclusive, we can write, both, \1 and \2 in the replacement zone ( or $1 and $2 ). We know that when one is defined, the other one is undefined and equivalent to an empty string ;-))

    Best Regards,

    guy038

  • XML Pretty Print and HTML

    14
    0 Votes
    14 Posts
    20k Views
    Frustrated SurferF

    @Adriano-Ellero How has your experience been with the Tidy2 solution since you posted Nov 11, 2020? I’ve integrated cmd line Tidy into my process and have no complaints about the output, just that it’s another set of chicanes between me and the finish line. Your initial assessment of the plugin had a caveat.

  • Intracacies of NPP Regex negative lookahead

    8
    0 Votes
    8 Posts
    692 Views
    guy038G

    Hi, @alan-kilborn,

    Regarding the regex syntax 1{2, this is considered as a pure literal expression, which correctly matches the 1{2 string

    But if you want to match the literal string 1{2}, as this syntax has the regex meaning : “two consecutive digits” 1, we need to escape the opening brace, {, only ( so 1\{2}1\{2} ) to get a literal expression !

    As defined here

    All characters are treated as literals, except for characters $, \, (, ), ?, and :

    If you want to write the $ ? and the : characters, literally, you do not need, most of the time, to escape them because they are usually found outside their meaning context !

    However, the three characters (, ) and \ must always be escaped, in the replacement zone, in order to be written literally !

    Parentheses are normally used for lexical grouping in conditional expressions, with these syntaxes :

    (?DigitTrue_Exp) or (?{Digit}True_Exp) or (?NameTrue_Exp)

    (?DigitTrue_Exp:False_Exp) or (?{Digit}True_Exp:False_Exp) or (?NameTrue_Exp:False_Exp)

    Apart from these cases, these two parentheses seem to just represent a pure empty string !

    For instance :

    SEARCH DEF

    REPLACE 123(456 or REPLACE 123()456

    would change the string ABCDEFGHI into ABC123456GHI

    And the S/R :

    SEARCH : DEF REPLACE : 123( (((XYZ)OP(QRS)TUV ()) )789 would change the string "ABCDEFGHI" into "ABC123 XYZOPQRSTUV 789GHI"

    Thus, the S/R :

    SEARCH DEF

    REPLACE ()

    would change the string ABCDEFGHI into ABCGHI ! In other words, the () syntax, in the replacement zone, seems to be a synonym of an empty string ;-)

    However, note that :

    SEARCH DEF

    REPLACE 123)456 or REPLACE 123)456(789

    would change the string ABCDEFGHI into ABC123GHI only !

    Now, placing some replacement meta-characters, inside parentheses, does not make them literal and they keep these normal behavior :

    For instance, the regex S/R :

    SEARCH (DEF)|XYZ

    REPLACE ---(123(?1TRUE:FALSE)456\\789)---

    would change the string ABCDEFGHI ABCXYZGHI into ABC---123TRUE456\789---GHI ABC---123FALSE456\789---GHI

    Finally, the only practical application I found of using parentheses, is when you want to delimit a string beginning and/or ending with space characters !

    Best Regards,

    guy038

  • Change location of the forward slash in every row containing 1 NAME

    5
    0 Votes
    5 Posts
    2k Views
    HVNFH

    Thank you very much!
    I used your last resolution: Find: (?-s)^1 NAME.*\K/((?:\S+\h+)) and replace with $1/
    it worked perfect!

    For people searching for this, i used it for batch editing a raw gedcom com familytree file.
    In older familytree software the firstname patronym and surname was noted differently so in a modern gedcom file the patronym would end op in the surname field.
    using notepad++ you can edit the raw gedcom file and with find and replace you can move the slash from the patronym to the surname.
    In this case it was a lifework from an old geneologist of 170.000 persons in a gedcom which was almost obsolete if this was not solved.
    Peter Jones thank you very much.

  • Function List MariaDB Scrip

    6
    0 Votes
    6 Posts
    622 Views
    Aquim ElifáA

    I forget to add how the image looks 3.jpg

  • 0 Votes
    3 Posts
    304 Views
    Alan KilbornA

    So for future people that come along looking maybe for a solution to something, and seeing this post, I say: It has several pieces of misinformation.

    First, the “spec” was:

    add something to the beginning of each line that does not contain the sign -

    In fact, the regex supplied does not do this. What it does is: Add something to the beginning of each line that does not start with -.

    Second, the OP diagnosed a problem as being that:

    There was no need for \ before -

    In fact, the removal of \ did nothing to change the outcome of the replacement operation. - does not need to be “escaped” in the usage shown by the OP. While it was true that there was “no need”, it didn’t make the first regex not work. The two regexes supplied by the OP do exactly the same thing.

  • Same Notepad++ version, different look n feel

    7
    0 Votes
    7 Posts
    398 Views
    mere-humanM

    Maybe, report a bug to Hex Editor also?

  • 7.9.5 Not Appending extension to files with period in name

    20
    0 Votes
    20 Posts
    5k Views
    mere-humanM

    @Brian-D Do you have this Hide extensions option ON by any chance?
    de64cd6e-f60b-4671-9ca8-89c2638c82b1-image.png

  • HTML colors in proper colors

    13
    0 Votes
    13 Posts
    6k Views
    PeterJonesP

    @Alan-Kilborn said in HTML colors in proper colors:

    Did the earlier code run too slowly?
    I ask because it seemed to process only what was on-screen to a user as opposed to the whole-file.
    … maybe you encountered some other difficulty relating to it.

    With my 90-color example, where I had multiple instances of those same 90 color blocks, as I would scroll up and down the file, it would slow down my scrolling as it kept redrawing the screen for every line of movement (ie, every time the UPDATEUI notification was triggered). That was annoying to me. My whole-file-once approach took 2-5sec to do the whole file, but then I could scroll to my heart’s content; the notification-based one-screen solution took <1s per screen, but it cost that same amount of time every scroll action; scrolling more than a few lines or a few times would quickly move the higher efficiency from one-page to color-once-then-move-freely.

    If I were editing a large HTML file (I don’t do that – I am just doing this because it is interesting and I had an idea I wanted to try), I think I would prefer colorizing the whole thing, on demand. If I were trying to decide which color to put in the HTML/CSS, the NppQCP would be a better option, because you could start with what you have, then tweak the value in the plugin. But if I just want a quick visual reference of what color each of those are as I’m editing other things in my HTML/CSS, I wouldn’t need to refresh it often, and doing the whole document one time would mean I could scroll throughout the document without further delays.

    To each his own, I guess. If someone wanted an on-demand-but-just-the-visible-screen, the start_position and end_position values could go back to the visible-line-start/ends that were in my first gist.

    Since I was implementing this more for my own learning than to help the OP, I decided to implement it in the way that would most likely match the way I might use the feature in the future. And both gists are still there, so either are available for direct use or for taking and editing to match one’s own use-case.

    I said,

    It may already be changed in the gist by the time you get here.

    It’s changed now, BTW.

  • Copy and paste within a Macro

    18
    0 Votes
    18 Posts
    2k Views
    gstaviG

    My macro:
    stand on beginning of Leicester
    start recording
    shift-end
    ctrl-c
    end
    space
    delete
    end
    space
    delete
    home
    down arrow
    ctrl-v
    end
    enter
    up arrow
    stop recording

    replay recording
    replay recording
    replay recording
    replay recording
    replay recording

    end up with extra Leicester to delete.

    A simpler approach would be to just merge every 2 lines and then add the common prefix with column editing.

  • 0 Votes
    2 Posts
    613 Views
    PeterJonesP

    @Darius-Runge ,

    I am glad that Notepad++ works for your dot matrix. I don’t think the developers do anything special to support that.

    I don’t know a lot of the behind-the-scenes in modern printing, but Notepad++ presumably shoots text data and font information (font name, size, weight, and color) at the driver, and the Windows printer driver for your printer presumably translates that into the right data for your individual printer.

    My guess is that characters-per-line (ie, page width) is a setting of your printer driver. Actually, it’s probably physical page width, rather than characters-per-line. For example, using the Microsoft Print to PDF driver that I get with MSOffice at work, I printed the same document twice from Notepad++: the first time, I did it in normal portrait orientation, and got about 82 characters of actual text (plus my line numbers in the left margin); I then did a second print in landscape (wide) orientation and got at least 20 more characters per line. So I think the printer driver tells Notepad++ “I have this much width”, and when Notepad++ then sends the data to the printer driver, Notepad++ uses that much width before wrapping the data.

    So, when you use File > Print from Notepad++, instead of immediately hitting Print from the dialog, try the Preferences, and see if you can define a page size that more accurately matches your actual paper size (or the effective paper size that Notepad++ should see to make use of the full width of your printer) – you might have to go into Advanced after choosing Preferences.

  • Defining own language - operators/comment style issue using the '§' sign

    2
    0 Votes
    2 Posts
    294 Views
    PeterJonesP

    @sesa150162 ,

    Unfortunately, the § is at codepoint U+00A7, which is outside the range that UDL officially supports (it is only guaranteed to work with U+0020 to U+007F). There have been at least two issues (#6014 and #8562) requesting Unicode support in UDL, but UDL doesn’t get much attention, so they remain open.

    As a workaround, you can add extra highlighting to a builtin lexer or to your User Defined Language (UDL) using regexes via the script EnhanceAnyLexer.py that @Ekopalypse shares in his github repo. Since the matching is done on the Python side, it has full Python 2.7 support for Unicode strings, so you should be able to define your regex inside that script like u'§\w+§' or maybe r'§\w+§'