• RegEx ,\ni

    4
    0 Votes
    4 Posts
    448 Views
    Olivier ThomasO

    Everything works…
    Thanks.

  • 0 Votes
    6 Posts
    658 Views
    John TeeJ

    @Terry-R Thank you very much the new update works great just what I needed. All the best and thank you @Terry-R and @guy038 for your time and guidance. Cheers

  • Possibility to calculate numbers?

    7
    0 Votes
    7 Posts
    24k Views
    PeterJonesP

    Sorry, I forgot my screenshot and debug info, which I meant to include above as evidence of my claim:

    7b483fc1-9ba8-4a7e-a417-15937bccd915-image.png

    Notepad++ v8.1.5 (32-bit) Build time : Sep 26 2021 - 15:15:32 Path : C:\usr\local\apps\npp\npp.8.1.5.portable\notepad++.exe Command Line : Admin mode : OFF Local Conf mode : ON Cloud Config : OFF OS Name : Windows 10 Enterprise (64-bit) OS Version : 2009 OS Build : 19042.1237 Current ANSI codepage : 1252 Plugins : mimeTools.dll NppConverter.dll NppExport.dll NppTextFX.dll
  • How can i get a specific deserialized code in npp++ to c#

    2
    0 Votes
    2 Posts
    489 Views
    EkopalypseE

    @Yunus-Emre-Kütükçü
    I’m not sure I understand this correctly. Do you mean the entire content?
    If so, then SCI_GETTEXT is the way to go.
    If you want to have only the part that contains the changed lines, then you
    you have to work with markers.
    Find them, find the start and end position of that line and use SCI_GETRANGEPOINTER to retrieve the text.

    I don’t know if this is relevant in your case, but make sure you consider text encoding.

  • replace first two spaces with - third space with tab

    3
    0 Votes
    3 Posts
    1k Views
    Glen_StromG

    @PeterJones said in replace first two spaces with - third space with tab:

    ${1}-${2}-${3}\t

    Thanks so much, exactly what I was looking for!

    Now that I have it done I’ll look closer at your solution & figure out what it all means.

    It turns out the text file was a little wonky, all of the months but September were 3 letter, and the rest already had a tab like I wanted after the 4 digit year, but the September months had a space. So it was like 31<sp>Aug<sp> 2021<tab>1234.56 and 01<sp>Sept<sp>2021<sp>6789.12 - so it was just a matter of replacing all the Sept with Sep, then running your solution on them, then I ran the () \b in the search with - in the replace for the rest of them.

    In any case, I was able to generate an insert statement & got all my rows into my database table, so thanks again!

  • is there a REMOVE UNNECESSARY BLANK only (not EOL also)?

    6
    0 Votes
    6 Posts
    479 Views
    PeterJonesP

    @Chris-Tanguay-0 said in is there a REMOVE UNNECESSARY BLANK only (not EOL also)?:

    I just need to convert any 2 or more consecutive spaces found

    FIND = \x20+ (this could be space-plus, +)
    REPLACE = \x20 (this could be a single space)
    SEARCH MODE = regular expression

    \x20 is a way of representing the space character that is easy to read/copy/paste from the forum; I mention both for ease of use. So if you’re typing, just type the characters for space and plus in the SEARCH dialog; if you’d rather copy/paste, it’s probably better for the \x20 version.

    BTW: this is what @Terry-R was hinting at, suggesting that you could easily figure out how to use regular expressions to search for more than one space and convert it to a single space… because that’s about the simplest modifier (+) in regular expressions.

    It will behoove you to start learning this on your own.

    ----

    Please note: This Community Forum is not a data transformation service; you should not expect to be able to always say “I have data like X and want it to look like Y” and have us do all the work for you. If you are new to the Forum, and new to regular expressions, we will often give help on the first one or two data-transformation questions, especially if they are well-asked and you show a willingness to learn; and we will point you to the documentation where you can learn how to do the data transformations for yourself in the future. But if you repeatedly ask us to do your work for you, you will find that the patience of usually-helpful Community members wears thin. The best way to learn regular expressions is by experimenting with them yourself, and getting a feel for how they work; having us spoon-feed you the answers without you putting in the effort doesn’t help you in the long term and is uninteresting and annoying for us.

    ----

    Do you want regex search/replace help? Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you. All example text should be marked as literal text using the </> toolbar button or manual Markdown syntax. To make regex in red (and so they keep their special characters like *), use backticks, like `^.*?blah.*?\z`. Screenshots can be pasted from the clipboard to your post using Ctrl+V to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data. Show the data you have and the text you want to get from that data; include examples of things that should match and be transformed, and things that don’t match and should be left alone; show edge cases and make sure you examples are as varied as your real data. Show the regex you already tried, and why you thought it should work; tell us what’s wrong with what you do get. Read the official NPP Searching / Regex docs and the forum’s Regular Expression FAQ. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.

  • 0 Votes
    5 Posts
    4k Views
    Ki AnK

    @PeterJones said in How to highlight repeated words (multiple words repeated), in a Text file?:
    Wow Great, highlight with Navigation too…
    saved a lot of time… Thanks a-lot

  • Editing a list/ Moving words

    23
    0 Votes
    23 Posts
    1k Views
    Mathew888M

    @Neil-Schipper
    Thanks for your info on Macros in this kind of situation, I’ve heard of them but have not used them previously.

  • Regex: Put a dot after every 10 words

    10
    0 Votes
    10 Posts
    945 Views
    guy038G

    Hi, @neculai-i-fantanaru and All,

    I forgot to explain why the first provided regex was (?:([\w'’]+)\W+){9}(?1)\K and not the regex (?:([\w'’]+)\W+){9}\1\K

    Well, the \1 right before \K would match the last occurrence of the group 1, that is the ninth word found with the regex [\w'’]+ !

    So, the regex (?:([\w'’]+)\W+){9}\1 would match strings like :

    111 222 333 444 555 666 777 888 999 999

    or

    000 111 222 333 444 555 666 777 888 888

    but NOT the string :

    000 111 222 333 444 555 666 777 888 999

    On the contrary, the (?1) syntax, is a subroutine call to the group 1 and is, fundamentally, identical to the regex [\w'’]+ itself. So, the regex (?:([\w'’]+)\W+){9}(?1) would also match my third example too and any other word ;-))

    Best Regards

    guy038

  • Version 8.1.4

    4
    0 Votes
    4 Posts
    367 Views
    forensicsmanF

    This is an image file that has this as just a regular downloaded file, and when I execute it on any system this happens, the image is defaulted to English and N++ installs in Dutch, there is nothing else being done to this file. I also have been doing this for years and never had an issue with the past versions of N++.

  • Find and search windows washed out

    3
    0 Votes
    3 Posts
    260 Views
    Terry RT

    @Michael-Agner-0 said in Find and search windows washed out:

    However when I try to use either Find or search, the box that comes up is completely washed out and is almost totally unreadable.

    I’m picking that your transparency settings are set wrongly. See my image below.

    9788583f-87d5-4dac-961d-3f1e957f6788-image.png

    The text above the find window refers to some of the contents of the config.xml file, usually found in the %appdata%\Notepad++ folder. So if you are unable to adjust the transparency via the find window, then open the config.xml file and directly edit the transparencyMode, making it 1. 1 means when the window is the focus it is fully showing, when set to 2 it will remain “washed out” even when in use which is what I expect you are seeing.

    Please note that as the config.xml file will be written to by Notepad++ if some settings are changed, editing this file should be done in a session in Notepad++ all by itself, closing Notepad++ after editing. Otherwise you may find your changes are removed.

    Terry

  • 0 Votes
    2 Posts
    429 Views
    PeterJonesP

    @Ryad-Arlan ,

    Search/replace (regex) does not know how to count. So it cannot increment your replacement, and it cannot count how many replacements it has done.

    To do that, you need a programming language. If you use a plugin like PythonScript, you can leverage the full power of the Python language and give it the access to the contents of the Notepad++ editor window. If you’re willing to go that route, you can search the forum for add_1 and find a lot of examples for the “add_1” style of pythonscript search-and-increment-replace. For stopping after 20 instances, you can look at the optional final argument of the editor.rereplace(search, replace[, flags[, startPosition[, endPosition[, maxCount]]]]) method.

    if you have trouble customizing what you’ve seen elsewhere for your specific situation, show us what you’ve tried, and we might be able to point out where it’s gone wrong.

  • 0 Votes
    4 Posts
    374 Views
    PeterJonesP

    @Clayton-Lewis said in Need numbers going up on every blank line followed by a previous line break for subtitles:

    except for step 3 part 2-4.

    You are right. After 3.4, I should have said another Begin/End Selection. Sorry. But yes, what you described is equivalent.

  • 0 Votes
    6 Posts
    2k Views
    PeterJonesP

    @Bader-Alharbi said in I want to compare two files and bookmark the lines containing similar words:

    is there a regex to add the line number in multiple places in the line?

    Regular expressions cannot count (they have no concept of “increment a number”). Your two options inside Notepad++ are using the Column Editor like you’ve already discovered, or using a scripting plugin like PythonScript and using the full power of a programming language to influence the text in the open file. (I actually just answered a question earlier today on that same concept.)

    apply it to different files with a different number of lines.

    as linked in that other topic (and the links refenced there), you can make a macro that will do the begin/end-select for column mode… and if you combined that with other controls, like the Ctrl+Home to go to the start of the file, and Ctrl+End to go to the end, you could have a macro that does the zeroeth-column select in the macro, then manually type Alt+C to bring up the column editor and insert the numbers, then you could use another regex (using multiple capture groups) to distribute the number from the beginning of the line to the various locations throughout the line that you need

  • Regex: Search and Replace in Chess PGN

    7
    0 Votes
    7 Posts
    538 Views
    jhone vickJ

    @Nguyen-Wanderoz Hey,
    i jus Wanna Need Your Help I am Having Some issue In My Project When I press Shift Button Mt [SpaceBar stop Responding.
    I Need [Help]

  • Visibility of EOL

    7
    0 Votes
    7 Posts
    768 Views
    astrosofistaA

    @Alan-Kilborn said in Visibility of EOL:

    I believe that a newer Scintilla editing component than N++ (8.1.4) currently uses is available which makes the effect less pronounced, but this newer component would have to be integrated into N++ in order to work.

    That is correct. For the curious among you, the new feature was introduced in Scintilla 5.1.0. See here for details.

  • .msi installer

    2
    0 Votes
    2 Posts
    948 Views
    Alan KilbornA

    @Muhammad-Farhan

    There is no .msi installer.
    Your download options are on the download site: https://notepad-plus-plus.org/downloads/v8.1.4/

  • Can't figure out a proper way to make this custom UDL work

    3
    0 Votes
    3 Posts
    333 Views
    TBlazeWarriorTT

    @PeterJones Thanks a lot for the clarification. I think the proposed solution is a bit too complex for me (and the operators didn’t cause me issues), and you’ve sadly confirmed that most bugs I’m experiencing are unfixable, so I might leave it the language as it is.
    It is a bit of a pity that it is like this, but it’s not too bad and at least now I know it’s not my fault, so thanks again

  • Splitting to multiple files

    8
    0 Votes
    8 Posts
    5k Views
    Terry RT

    @Alan-Kilborn said in Splitting to multiple files:

    Did you have something in mind that was more sophisticated than that (but still a poor approach compared to non-N++ solutions)?

    Nope, just the same as you. it would require effort in setting up the PythonScript (or other program lang.), or regex to do the job. then if OP wasn’t happy with result, having to change the process to accommodate. The non-N++ solutions have all those options baked in, so far easier.

    Also the number of lines the OP stated makes me wary that a buffer overload may occur as well.

    Terry

  • Linking html to css

    5
    0 Votes
    5 Posts
    1k Views
    PeterJonesP

    For future readers, don’t have the same misunderstanding as was expressed above: we help Notepad++ users to use Notepad++. We are quite happy to do so. I personally tackle many Notepad++-related problems in this forum nearly every day. Just look at the recent posting history for factual proof of this.

    What we cannot be is the entirety of stack exchange: we do not have experts on every possible programming language and every possible markup language and every possible cookie recipe.

    Just because you use a particular text editor to type your source code doesn’t mean that the forum for that text editor should be expected to answer any programming questions you have.

    If you have a C-programming question, go to a forum that specializes in C. If you have an HTML+CSS+JavaScript question, go to a forum about web authoring. If you have a question about cookie recipes, go to a cooking or baking forum. If you have questions about how to sort the text in your text file that you’re editing with Notepad++, this is the right place for you.

    But going back to @Munawar-Ali’s question: it was said, “still it just shows the html on browser” – that might be interpreted as “it is showing the raw HTML markup rather than the rendered webpage”. If that’s the case, then you can use Notepad++ to save the file as HTML and give it a .html extension. And when you are using Notepad++ to type your HTML and CSS files, you can have your saved HTML file in the active tab in Notepad++ and run View > View Current File in… to pick your favorite browser, and Notepad++ will issue the command for that browser to open the active file in the browser; if it’s properly saved as HTML, and the browser will render that HTML file as a local webpage; if the HTML is written correctly (with all the files in the right place relative to each other), then it will render correctly in the chosen browser.