• Login
Community
  • Login
  1. Home
  2. Help wanted · · · – – – · · ·
Log in to post
Load new posts
  • Recently Replied
  • Recently Created
  • Most Posts
  • Most Votes
  • Most Views
  • K

    beginner looking for regex to find & replace

    Watching Ignoring Scheduled Pinned Locked Moved
    4 Aug 13, 2018, 5:48 PM
    Aug 13, 2018, 3:49 AM
    1 Votes
    4 Posts
    1k Views
    C Aug 13, 2018, 5:48 PM

    @krat-chouf

    one way would be to define the remaining part as part of a regex lookahead,
    which basically means something like: this only matches if the following text follows.
    So in your case and what has been already discussed you could modify it like

    find: (?is)(<group name\=“caliper”>.+?“offset”).+?(?=>.*?</item>)
    replace: \1 units=“micron” loLimit="-50" hiLimit=“50”

    Cheers
    Claudia

  • Χ

    MERLIN-PRO ASSEMBLER SYNTAX HIGHLIGHTING

    Watching Ignoring Scheduled Pinned Locked Moved
    2 Aug 13, 2018, 1:08 PM
    Aug 12, 2018, 3:23 PM
    0 Votes
    2 Posts
    856 Views
    P Aug 13, 2018, 1:08 PM

    The UDL (User Defined Language) lexer is not set up for highlighting random words, or even words that match a certain regular expression.

    If you want any unrecognized word to be a certain color, pick that certain color as the default color for your UDL, and make sure that all known words (like the EQU listed above) are in one of the keyword lists.

    You might want to study this other Topic in the forum, where @Claudia-Frank shared PythonScript code which will do customized highlighting; it was shown with an example of highlighting Python differently than the normal Python lexer does… but you might be able to make it do what you want. (Note: once you get to the post where Claudia shows the screenshot and the PythonScript code, the relevant content of that thread is complete; it kind of went off on a tangent after that. :-) ) I’m sure if you @-mention @Claudia-Frank here or in that thread, she’ll be happy to answer questions you might have on how to make it work for your use case (assuming it’s possible; I’ve never used that code).

  • B

    Is it possible to run text through an external program?

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Aug 12, 2018, 11:12 PM
    Aug 11, 2018, 3:18 PM
    1 Votes
    3 Posts
    4k Views
    B Aug 12, 2018, 11:12 PM

    @PeterJones Perfect… thanks very much!!

  • S

    Showing the last line in a code fold. Possible?

    Watching Ignoring Scheduled Pinned Locked Moved
    2 Aug 12, 2018, 12:38 PM
    Aug 11, 2018, 7:46 PM
    0 Votes
    2 Posts
    789 Views
    D Aug 12, 2018, 12:38 PM

    Unfortunately it can not be done without significant C++ code changes.

  • A

    How to remove all lines before the first : if there are 2 :'s in the file?

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Aug 11, 2018, 11:06 PM
    Aug 11, 2018, 10:27 PM
    0 Votes
    3 Posts
    1k Views
    P Aug 11, 2018, 11:06 PM

    Your subject line and the example are not specific enough, and possibly contradict each other:

    The subject says you want to remove all lines before the first : in the file if there are two :s in the file. That would say that

    first line second line hello : second : here

    would become

    hello : second : here

    But your example doesn’t seem to agree.

    Based on your example, I assume you want something like:

    hello:pig:cake hello;pig;cake -- note, this line is semicolons, not colons hello:pig:cake

    to become

    :pig:cake hello;pig;cake -- note, this line is semicolons, not colons :pig:cake

    Could you please give a bigger example document, showing us both the before and after? (To include your text verbatim, as I have, prefix every line in the text by 4 spaces, with a blank line before and after)

    Also, show what you tried.

    this faq will give you a good start on regular expressions.

    If you give a fuller explanation of what you want, and some indication that you’re willing to put in effort and learn, you’ll probably get one or more answers in short order. (Though it’s the weekend, so “short order” might be Monday. Ahh, @Terry-R showed up, so you might even get it sooner. Depends on who’s around when you clarify things.)

  • J

    How do I search for non regular expression values?

    Watching Ignoring Scheduled Pinned Locked Moved
    2 Aug 10, 2018, 9:46 PM
    Aug 10, 2018, 8:25 PM
    0 Votes
    2 Posts
    806 Views
    P Aug 10, 2018, 9:46 PM

    Search > Find
    In the Find What, enter your regular expression.
    In the Search Mode section, enable the ☑ Regular Expression

  • M

    Is there any way to have N++ start in overwrite mode, instead of insert mode?

    Watching Ignoring Scheduled Pinned Locked Moved
    4 Aug 10, 2018, 6:41 AM
    Jul 31, 2018, 4:43 AM
    2 Votes
    4 Posts
    2k Views
    O Aug 10, 2018, 6:41 AM

    I had this question too. Finding the answer was easy. I thought I was in for hours of searching. I looked at only one other place before coming to this one and to my surprise the question/answer was staring at me in the face. The entry outlining the steps was helpful indeed. Notepad++ transformed the way I do many things. I am just now learning and already understand it’s value. Keep up the good work. My performance is based on the knowledge of others. Thanks!

  • W

    文件夹工作区 Folder as WorkSpace

    Watching Ignoring Scheduled Pinned Locked Moved
    1 Aug 10, 2018, 2:07 AM
    Aug 10, 2018, 2:07 AM
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • T

    Double spacing when editing PHP

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Aug 9, 2018, 3:46 PM
    Jul 16, 2018, 1:34 PM
    0 Votes
    3 Posts
    2k Views
    S Aug 9, 2018, 3:46 PM

    don’t double space!, use tab!

  • C

    Select links by double clicking them? (or a specific part of them?)

    Watching Ignoring Scheduled Pinned Locked Moved
    7 Aug 9, 2018, 1:22 PM
    Aug 9, 2018, 12:20 PM
    2 Votes
    7 Posts
    2k Views
    C Aug 9, 2018, 1:22 PM

    It works perfectly, great!

    Thank you again!

  • Marty KayM

    Date and time

    Watching Ignoring Scheduled Pinned Locked Moved
    2 Aug 9, 2018, 1:09 PM
    Aug 9, 2018, 12:40 PM
    0 Votes
    2 Posts
    2k Views
    P Aug 9, 2018, 1:09 PM

    This old thread shows a PythonScript example which will insert it. You could then add that to the PythonScript menu items, and assign a shortcut to it using Settings > Shortcut Mapper

    (This stackoverflow answer has lots of good screenshots of the process, with a slightly different date format.)

  • prasad konnurP

    reload all opened files

    Watching Ignoring Scheduled Pinned Locked Moved
    2 Aug 9, 2018, 11:45 AM
    Aug 9, 2018, 6:55 AM
    2 Votes
    2 Posts
    2k Views
    Scott SumnerS Aug 9, 2018, 11:45 AM

    @prasad-konnur

    A long-known trick, if you want to say Yes to Do you want to reload it? for ALL of the files (which in this case I presume you do)…is to hold down the Y key until all of the popups go away.

    This will likely leave you a string of undesired yyyyyyyyyyyy in one of your editor windows, but a simple Undo (ctrl+z) gets rid of those.

  • Angelique PughA

    Find and Replace displays Box instead of characters but are displayed fine in file.

    Watching Ignoring Scheduled Pinned Locked Moved
    3 Aug 8, 2018, 10:36 PM
    Aug 7, 2018, 3:20 PM
    0 Votes
    3 Posts
    935 Views
    C Aug 8, 2018, 10:36 PM

    @Angelique-Pugh

    ok, the logical font used is Ms Shell Dlg.
    You need to check the registry at

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Current Version\FontSubstitutes

    to see it’s real font. At my system it is MS Sans Serif.
    To fix a broken font you could try to goto
    Control Panel\All Control Panel Items\Fonts\Font settings
    and press the resore default font settings button, if this doesn’t
    help try to reinstall it.

    Cheers
    Claudia

  • Toasty HDDsT

    Issue: Default session is lost after using two sessions at one time

    Watching Ignoring Scheduled Pinned Locked Moved
    5 Aug 8, 2018, 10:08 PM
    Jul 8, 2018, 5:57 PM
    0 Votes
    5 Posts
    2k Views
    C Aug 8, 2018, 10:08 PM

    @Toasty-HDDs

    https://visualstudio.microsoft.com/de/vs/community/?rr=https%3A%2F%2Fduckduckgo.com%2F

    Free and I use it myself, it works.

    Cheers
    Claudia

  • Сергей КопышевС

    How to highlight certain words by color?

    Watching Ignoring Scheduled Pinned Locked Moved
    4 Aug 8, 2018, 10:06 PM
    Aug 6, 2018, 12:19 PM
    1 Votes
    4 Posts
    2k Views
    C Aug 8, 2018, 10:06 PM

    @Сергей-Копышев

    see here what could be done.

    Cheers
    Claudia

  • Scott K. SmithS

    UDL Folding Fail -Help Please

    Watching Ignoring Scheduled Pinned Locked Moved
    2 Aug 8, 2018, 2:12 PM
    Aug 8, 2018, 1:17 PM
    0 Votes
    2 Posts
    727 Views
    Scott K. SmithS Aug 8, 2018, 2:12 PM

    After several days hacking away at this, I found the problem was simple EOL conversion. All the scripts that I have been working originated in unix (LF). Edit->EOL Conversion->Windows (CR LF) on the file makes it obey my UDL folding.

    I would like to thank a someone who replies on this list, since I found the tip about checking the EOL in another post. Now I can’t find the post…

  • Samos007S

    Find content in files and rename/delete files not containing content

    Watching Ignoring Scheduled Pinned Locked Moved
    7 Aug 7, 2018, 6:14 PM
    Aug 7, 2018, 3:43 PM
    0 Votes
    7 Posts
    3k Views
    P Aug 7, 2018, 6:14 PM

    I doubt @Samos007 will come back to confirm, but I am assuming Samos actually used File Explorer to delete the files after updating their timestamps and sorting by date.

    (And I’m happy that Samos didn’t just expect us to solve the problem, but put more effort into it; that’s encouraging that there are still random users who do put in effort into their own issues.)

    If Samos does return, Scott’s “without any special tools” challenged me: using only Windows builtin commands, two one-liner alternatives:

    for %F IN ( *.txt ) DO @( FIND /C "special text" %F > NUL && DEL %F) for %F IN ( *.txt ) DO @( FINDSTR /L "special text" %F > NUL && DEL %F)

    the builtin FIND command, using FIND /C, will print out a count of the number of matches, and also return an %ErrorLevel% of 0 to the system if it matches, or 1 if there’s no match; since I don’t care about the printing, I redirect it to NUL. I then use the windows && to cause the next command to only run if the previous %ErrorLevel% was 0 (a match). DEL will thus be run only on any files that match

    The builtin FINDSTR command, using FINDSTR /L, works similarly.

    Someday, I’ll maybe think “FINDSTR” or “FIND” instead of gnuwin32’s “grep” for matching text in Windows files… but probably not before MS has discontinued cmd.exe completely and forced me to learn PowerShell.

  • MarkomarinM

    How to make new lines without deleting

    Watching Ignoring Scheduled Pinned Locked Moved
    17 Aug 7, 2018, 9:53 AM
    Aug 6, 2018, 4:45 PM
    0 Votes
    17 Posts
    3k Views
    MarkomarinM Aug 7, 2018, 9:53 AM

    @Scott-Sumner
    That was just the thing I was looking for, that was another thing I learned from this great community, Thanks guys.

  • Karun PoudelK

    Collapse level 2 not working for python language

    Watching Ignoring Scheduled Pinned Locked Moved
    2 Aug 6, 2018, 8:34 PM
    Aug 6, 2018, 7:56 PM
    1 Votes
    2 Posts
    932 Views
    P Aug 6, 2018, 8:34 PM

    I tried on v7.5.6 32bit, and it seems to not work right for me: collapse level 2 doesn’t collapse the two def’s. When I switched to a different language (Perl), with

    sub blah { do { tertiary: { 1; } }; while(1) { } }

    I was able to properly collapse and uncollapse levels 1, 2, or 3 without difficulty in Perl; but if I switch the language to python, it will only do level 1.

    Thus, it doesn’t seem to be solely the fault of v7.5.8, and it seems to be limited to Python.

    I just searched the issues page, and found https://github.com/notepad-plus-plus/notepad-plus-plus/issues/4633 already reported … Based on what they said there (each space if indent gives a new level), I tried to collapse level 5 on your example, and the two def’s collapsed. So the bug isn’t with Notepad++, it’s with the Python-lexer that comes bundled with Scintilla that comes bundled with Notepad++. And it appears that it’s not going to be fixed, because the author disagrees that it’s a bug (it’s working as he designed it, apparently).

    So you might have to get used to calling a 4-space indent “level 5”. (sorry to be the bearer of bad news.)

  • M

    How to find numbers and start new lines with the numbers

    Watching Ignoring Scheduled Pinned Locked Moved
    9 Aug 6, 2018, 7:38 PM
    May 23, 2018, 1:14 PM
    0 Votes
    9 Posts
    4k Views
    P Aug 6, 2018, 7:38 PM

    (argh, typo. That should have been TIMTOWTDI… where’d my I go?)

The Community of users of the Notepad++ text editor.
Powered by NodeBB | Contributors