• Help for mass replacement.

    Locked
    2
    0 Votes
    2 Posts
    445 Views
    guy038G

    Hello, владимир-антониковn, and All,

    Assuming that your XML text uses :

    Regular Simple quote ( ' ), of Unicode value \x{0027}, and not the characters and

    Regular Double quote ( " ), of Unicode value \x{0022}, and not the characters and

    These changes of text can be easily done with regular expressions :-))

    Open the Replace dialog ( Ctrl + H )

    SEARCH ><img src="(.*?)"\x20(alt=".+?").+?\x20/(></a>)

    REPLACE \x20class="item"\x20style="background-image:\x20url\('\1'\)"\x20data-\2\x20\3

    Tick, preferably, the Wrap around option

    Select the Regular expression search mode

    Click, once on the Replace All button or several times on the Replace button

    Et voilà !

    If OK, I’ll give you some explanations on that regex S/R, next time

    Best Regards

    guy038

  • Special Character Issues

    Locked
    4
    0 Votes
    4 Posts
    3k Views
    English CrusaderE

    @Meta-Chuh Thank you for the answer, Unfortunately the updating solution has proved to be ineffective. And i had already used your other reccomendations in a previous attempt to fix the issue.

  • XQuery UDL

    Locked
    14
    0 Votes
    14 Posts
    4k Views
    Robert KirkpatrickR

    I did follow the instructions about the portable version strictly.
    I will continue the investigation myself.

  • Help required to remove unwanted strings of text

    7
    0 Votes
    7 Posts
    2k Views
    fotofrankF

    @guy038,

    Thanks!
    Though I’m using Regular Expressions a LOT, I’m always forgetting about the in-line modifiers.

    Greetz,
    fotofrank

  • Unwanted Moving Text

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    Terry RT

    @Flare said:

    When Ever I Type

    If you were to look at the bottom right of Notepad++ (NPP) you should see INS. This means insert. NPP will start in this mode (at least mine does). If you hit the Insert key it will change to OVR which means overwrite. In this mode any text in front of the cursor will be overwritten by what you type.

    This is all by design, you just need to understand what mode you are in.

    Terry

  • Header and Footer variable needed for total number of pages

    Locked
    2
    0 Votes
    2 Posts
    759 Views
    PeterJonesP

    @Ian-McClain, Welcome to the Notepad++ Community forum.

    a header/footer variable for the total number of document pages

    That’s been suggested in the official issue tracker a couple years ago (issue #3610). That tracker is the official location for submitting feature requests, so they can be properly tracked. If you want to add your support to that ticket, feel free.

  • regex on fixed length string, replacing one character

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    Terry RT

    @poyntzj said:

    replace one of the characters with another

    If I understand correctly you want to change the character 0 with a 5 ONLY if the line length is EXACTLY 32 characters long with a < following.

    When a problem gets complicated consider breaking it down into steps. At first glance I would:

    use the current search string that works to ALSO tag the line with special characters, either at the start or start and end, say possibly a % character. create another search (replace) regex to ONLY work on the lines with these special characters to replace the 0 with a 5 as your example suggests.

    I hope that gives you an idea.

    Terry

  • Help- Accidental keystroke puts me on first tab

    Locked
    3
    0 Votes
    3 Posts
    507 Views
    Jennifer MinellaJ

    Thanks! It’s very unlikely because of where my CTRL key and number pads are. And it always goes to the first tab (e.g. ctrl-1). It’s happening during standard word-based typing.

  • How do I change the color of a text before a specific character?

    Locked
    5
    0 Votes
    5 Posts
    3k Views
    Roger TXR

    Thank you for answering my questions, I have found an appropriate style that suits what I am looking for. (TeX)

    The file is an INI text, I just wanted to translate its contents easily by finding the correct words … Once again thanks for responding and being aware.

  • How to enable side panel

    Locked
    4
    0 Votes
    4 Posts
    4k Views
    toubeptT

    Thank you both. It turned out to be the Snippets plugin. The panel is back after enabling it. :) I’ve done other updates prior to this one and never lost that panel. I appreciate the help in getting it back.

  • How to change colors of highlights?

    3
    0 Votes
    3 Posts
    1k Views
    Kiichiro MatsushitaK

    Solved. Thank you!

  • I need help

    Locked
    2
    0 Votes
    2 Posts
    617 Views
    Terry RT

    @Andrew-Messier said:

    I have a file that I need to code in

    If you were to check the web you would have likely found it is most likely a Web Video Text Tracks File. See https://fileinfo.com/extension/vtt
    It is a text file, however I would suggest you need the appropriate editor to edit/create this type of file.

    Notepad++ is designed to edit text files, however it doesn’t necessarily understand the correct formatting of data within each file, so using it would IMO likely create a bad file.

    Terry

  • 1 Votes
    3 Posts
    832 Views
    David Ignacio Alcántara GarcíaD

    Oh my… I didn’t type the disjunction pipe (|) between the single line comment’s RE and the string literals’ one. How awful of me…
    Thank you very much, @MAPJe71 , yours works flawlessly. You’ve even added the restriction of multi-line comments’ delimiters to be at the start of the line, which I also missed.
    However, though not explicitly said in the AHK documentation, multi-line comments allow arbitrary indentation before their delimiters, so I’ve added that as well, a minor change.

    Also, single line comments’ delimiter in this language must not be preceded by non-space, so I’ve added the assertion (?<!\S) too, which is clearer than the original I used, (^|\s) (which is not even an assertion, but does the trick).
    And, regarding the flags, I think neither the multi-line nor single-line RE flags are explicitly needed in the expression, since they are both enabled by default in the parser (I’ve tested it), and the negated single-line flag can be bypassed by using the non-greedy wildcard, as I originally did. But, anyways, they clarify the purpose of the RE, and even if the Functions List engine changed its behavior regarding this matter, your RE would continue to work, so I’ll use the explicit flags as well.

    I should probably have done the comentExpr and classRange’s mainExpr with the extended RE flag, as the other larger ones, so this wouldn’t have happened.
    Sorry I posted for nothing, it was already night and I was losing all hope. Thank you for your quick response. ^^

    Also, regarding the displayMode attribute, I knew it wasn’t used as of now, but I had read it was reserved for future use, so I tried to guess something and see if it worked in the future. But now that you mention it, I’ve checked the other native parsers in the file and none of them include it, so I guess this implementation has perhaps been cancelled and I’ve removed it from mine as well. Thanks.

    Btw, I’ve noticed that global functions are unaffected by the commentExpr, yet not methods within classes. It’s not a problem at all, but it surprised me, so I’ll let it written here in case someone is puzzled by this as well. In a code like this:

    class myClass { /* myMethod() ... */ } /* myFunction() ... */

    myFunction will be found by the parser, yet being commented, but not myMethod, which is commented as well (regardless of the indentation of the comment delimiters).

  • mark the lines that you have n characters

    Locked
    4
    0 Votes
    4 Posts
    744 Views
    VivianjenylordV

    @guy038 so is friend, I help a lot the Regular expression, I thank you very much for your help

  • How to remove lines that do not contain ONLY alphanumeric characters.

    Locked
    2
    0 Votes
    2 Posts
    1k Views
    Terry RT

    @Nicholas-Wetzel said:

    one or more non alpha-numeric

    You could use the Mark feature, which I suggest as you may otherwise find that you have removed lines you did not wish to do so.

    So with Mark (under Search, then mark) have the Find What line containing
    [^0-9a-z]
    Make sure the ‘Bookmark line’ is ticked and have the Search Mode set to 'regular expression. Click on mark All.
    All lines containing at least one character which is NOT a number (0-9) or a alpha (a-z & A-Z) will be marked by a symbol at the start of a line (mine is a blue circle).

    At this point you could just select the option in the menu (under Search) called Bookmark, then Remove Bookmarked Lines, however i strongly suggest you check at least some of the bookmarked lines as I suspect you will find you may have forgotten other characters which you wish not to select. If so then they can also be added to the regex inside the [], before selecting Mark again, Clear Marks and trying again.

    Terry

  • 70% CPU-Usage on notepad-plus-plus.org o_O

    7
    0 Votes
    7 Posts
    5k Views
    erenseymenE

    Evernote Web Clipper extension is the culprit. Disable and try.

  • Can't Install Customize Toolbar

    Locked
    5
    0 Votes
    5 Posts
    895 Views
    gtshadowG

    Upgrading to newest version solved the problem. Thanks for your help, @Meta-Chuh

  • Problems with certain functionality on extremely large files

    Locked
    3
    0 Votes
    3 Posts
    731 Views
    Alan KilbornA

    Yea. “Big” data can be a problem. I’d go with Jim’s idea. In fact, I have in the past done this exact thing. Here’s a “cleaned up” version of some standalone Python I have, in the chance that it will help you:

    import re myfile = r'C:\foo\bar.txt' myregex = r'' lines_after_count = 2 countdown = 0 with open(myfile) as f: for line in f: line = line.rstrip() if re.search(myregex, line): print(line) countdown = lines_after_count elif countdown > 0: print(line) countdown -= 1
  • Extract email please

    Locked
    3
    0 Votes
    3 Posts
    1k Views
    rovitieR

    eternally thank you my friend

  • How to launch in chrome, etc??

    Locked
    5
    1 Votes
    5 Posts
    22k Views
    PeterJonesP

    @Steve-Lazarus said:

    I’ve been pulling my hair out trying to un-comment the shortcut file.

    That’s odd. My 7.6.6 puts those just fine when i remove the XML-comments wrapping those statements. Procedure = Close all Notepad++ instances; open single instance of Notepad++, edit the correct shortcuts.xml (%AppData%\Notepad++\shortcuts.xml for a normal installation), save, exit Notepad++, open Notepad++: should now show the updated Run menu.

    I mean, with it built into the View Menu, there’s no reason to use the shortcuts.xml/Run-menu version, but the old-style Run menu ones should work (and does for me) when properly enabled in v7.6.6.