• How to remove all HTML tags except <p> or <h1> <h2> tags?

    4
    0 Votes
    4 Posts
    4k Views
    NZ SelectN

    I found this code will do the job
    </?(?!a)(?!p)(?!ul)(?!li)(?!h)\w*\b[^>]*>

  • Formula in Replace function

    3
    0 Votes
    3 Posts
    2k Views
    Terry RT

    @wielki-asasyn said in Formula in Replace function:

    I would like to replace the “D001” part of the name with D002, D003, D004 etc to have unique names.

    I thought I knew what you wanted, proceeded to produce a solution using regular expressions, then once I read your post again I’m not sure I have the correct interpretation. So I’ll ask some questions.

    The single line of example above, are there about 350+ similar lines of text needing replacing? Is the single line provided actually a portion of the 1 (and only) line in the file thus within that 1 line there will be approximately 350+ names?

    If the answer to #2 is yes, that’s the idea I followed. My solution involves a few steps. Firstly we’d need to cut this down into individual lines so each name was on a line by itself. Then we’d use the column editor to add an increasing number to the start of the line. Then we’d replace the existing “Dnnn” string with the number at the start of the line. Lastly we’d merge the records back into the original format.

    So my steps are.
    Using the Replace Function we have
    Find What:\|[^”]+”(?!})\K
    Replace With:\r\n

    Search mode MUST be regular expression. Click on the Replace All button.
    So now each name should be on a separate line. Note the regex uses a negative lookahead so that we don’t create a line with the } on it by itself.

    Now the cursor must be placed at the first line, first position, actually immediately before the first character. We use the Column Editor (under Edit main menu) and select “number to insert” and use initial number of 1, increase by 1 and leading zeros MUST be ticked, click OK. Provided you have correctly located the cursor you will now see every line is preceded by a 3 digit number, increasing by 1 each line. Since you say there were approximately 350+ names every number created should be 3 digits long as you requested.

    Now we use another regex to move this, replacing the existing number using Replace function.
    Find What:^(\d{3})(.+?)(“D)\d{3}
    Replace With:\2\3\1

    Again search mode MUST be regular expression and wrap around ticked. Click on the Replace All button

    Confirm the numbers have been correctly replaced. Last step is to join the separated lines back to the original format. So again using the Replace function.
    Find What:[^}]\K\R
    Replace With: nothing in this field, leave it empty.

    Click on the Replace All button and now you should have the format you wished with unique numbers for each name.

    Terry

  • 0 Votes
    6 Posts
    990 Views
    Alan KilbornA

    Additionally, here are some basic instructions for installing Pythonscript and getting a script to run:

    https://community.notepad-plus-plus.org/post/54655

    And here’s some stuff about binding the execution of a script to a keycombo:

    https://community.notepad-plus-plus.org/post/55131
  • Notepad++ 7.8.9 32bit freezes with dbf file

    11
    0 Votes
    11 Posts
    4k Views
    Jack SmitheJ

    @Ekopalypse
    I didn’t know about DBF Viewer Plus. I was given an assignment with a deadline and went to the tools I know how to use. I completed the assignment last night so this morning I was able to delve into the notepad++ issue and discovered the source of the problem. Thank you for telling me about DBF Viewer. Once I figure out how to use it it will be a big help. If all I have is a hammer everything looks like a nail. Now I have a crowbar so now I can do more with less effort.

    @Alan-Kilborn
    The dbf is 6 lines long according to Notepad++. Line 6 is the one I am interested in which takes up 98% of the file. Now that I have DBF Viewer that should make things easier in the future. I will definitely keep this in mind for if I can’t use DBF Viewer.

  • Change Indent Keyboard Shortcut?

    27
    0 Votes
    27 Posts
    11k Views
    Alan KilbornA

    Here’s a weird condition…maybe:

    Select one or more empty lines.
    Press Tab.
    Exactly nothing happens.

    My goal was to have leading whitespace inserted on all lines at once, for each press of the tab key.

  • How to change App color to Dark theme?

    3
    1 Votes
    3 Posts
    763 Views
    sadicusS

    …and everything else was going so well, that is disappointing. I suppose that is why nothing can be perfect.
    thanks for the update!

  • How to delete rows / data based on the value in the header

    5
    0 Votes
    5 Posts
    2k Views
    Leszek BednarskiL

    Hello @guy038,

    Thank you very much! Not only for the help but also the very detailed, valuable explanations and references.
    At this point in my learning curve, it so complicated that it is just blowing my mind :)

    Best Regards
    LB

  • Find previous broken if using regular expressions

    4
    0 Votes
    4 Posts
    341 Views
    guy038G

    Hello, @derrick-gunter, and All,

    Since Notepad v7.8.7 version, the backward search is not allowed, by default, when Regular expression mode is set !

    But, as @michael-vincent, said, in his post, there is a new regexBackward4PowerUser attribute of the FindHistory tag, in the Config.xml configuration file. Just change its value from no to yes ;-))

    <FindHistory nbMaxFindHistoryPath="10" nbMaxFindHistoryFilter="10" nbMaxFindHistoryFind="10" nbMaxFindHistoryReplace="10" matchWord="no" matchCase="yes" wrap="no" directionDown="yes" fifRecuisive="no" fifInHiddenFolder="no" dlgAlwaysVisible="no" fifFilterFollowsDoc="no" fifFolderFollowsDoc="no" searchMode="2" transparencyMode="1" transparency="150" dotMatchesNewline="no" isSearch2ButtonsMode="no" regexBackward4PowerUser="yes">

    Best Regards,

    guy038

  • Encode Croatian UTF8 to ISO8859-1

    2
    0 Votes
    2 Posts
    1k Views
    EkopalypseE

    @Branko-Colavizza said in Encode Croatian UTF8 to ISO8859-1:

    Open the saved file and all the encoding is lost.

    What does that mean?
    What does the encoding field, the second from the right in the statusbar show?
    Could it be that you have to disable Settings->Preferences->MISC.->Autodetect character encoding?

    If the issue still exists, can you please post your debug-info, which is available from the ? menu?

  • Find in Files two phrases

    8
    0 Votes
    8 Posts
    336 Views
    Scott WallaceS

    @Alan-Kilborn said in Find in Files two phrases:

    (?s)Material Transfer Number.*?\KPosting Date

    Alan, the issues were typos on my side. The (?s)Material Transfer Number.*?\KPosting Date gave me exactly what I needed.
    Thank you so much for all your help.

  • 0 Votes
    9 Posts
    2k Views
    Владимир АнисимовВ

    @guy038 Thanks for the help. You have expanded my boundaries how else you can work with the regular season. Thanks you.

  • Wildcards in UDL

    4
    0 Votes
    4 Posts
    1k Views
    EkopalypseE

    @F2-Andy

    The actual documentation is on github a source.
    The documentation found on sourceforge is, afaik, outdated.

    For coloring, I posted a possible solution here.

    If there is anything I can do, let me know.

  • Replacing text at line-end

    15
    0 Votes
    15 Posts
    6k Views
    guy038G

    Hello, @terry-r and All,

    After numerous tests, here are my conclusions about the insertion of ASCI symbols, with Unicode code-point < \x{007F}, in replies on NodeBB forum

    Four cases will be considered :

    Inside Normal text, possibly emphasized :

    Writing of the symbol itself

    Writing of the symbol, preceded by a backslash \

    Inside Code Span zones or Code Block zones ( delimited between two lines of 3 backticks or two lines of 3 underscores ) or text indented with 4 space chars :

    Writing of the symbol itself

    Writing of the symbol, preceded by a backslash \

    - If inside NORMAL text, possibly EMPHASIZED : •------•--------* •---------•--------* | Type | To get | | Type | To get | •------•--------* •---------•--------* | \\[ | [ | | \\\\\[ | \\[ | | \\] | ] | | \\\\\] | \\] | •------•--------* •---------•--------* | | | | | | | \\ | \ | | \\\\ | \\ | | \* | * | | \\\* | \* | | \+ | + | | \\\+ | \+ | | \# | # | | \\\# | \# | | \- | - | | \\\- | \- | | \= | = | | \\\= | \= | | \> | > | | \\\> | \> | •------•--------* •---------•--------* | { | { | | \\{ | \{ | | } | } | | \\} | \} | | ( | ( | | \\( | \( | | ) | ) | | \\) | \) | | ^ | ^ | | \\^ | \^ | | $ | $ | | \\$ | \$ | | . | . | | \\. | \. | | | | | | | \\| | \| | | ! | ! | | \\! | \! | | " | " | | \\" | \" | | % | % | | \\% | \% | | & | & | | \\& | \& | | ' | ' | | \\' | \' | | , | , | | \\, | \, | | / | / | | \\/ | \/ | | ; | ; | | \\; | \; | | < | < | | \\< | \< | | ? | ? | | \\? | \? | | @ | @ | | \\@ | \@ | | _ | _ | | \\_ | \_ | | ` | ` | | \\` | \` | •------•--------• •---------•--------• - IF inside a CODE SPAN zone `....` or a CODE BLOCK zone ~~~....~~~~ / ```....``` or in text INDENTED with FOUR spaces : •------•--------* •--------•--------* | Type | To get | | Type | To get | •------•--------* •--------•--------* | [ | [ | | \\\[ | \\[ | | ] | ] | | \\\] | \\] | •------•--------• •--------•--------• | \ | \ | | \\ | \\ | | * | * | | \* | \* | | + | + | | \+ | \+ | | { | { | | \{ | \{ | | } | } | | \} | \} | | ( | ( | | \( | \( | | ) | ) | | \) | \) | | ^ | ^ | | \^ | \^ | | $ | $ | | \$ | \$ | | . | . | | \. | \. | | | | | | | \| | \| | | ! | ! | | \! | \! | | " | " | | \" | \" | | # | # | | \# | \# | | % | % | | \% | \% | | & | & | | \& | \& | | ' | ' | | \' | \' | | , | , | | \, | \, | | - | - | | \- | \- | | / | / | | \/ | \/ | | : | : | | \: | \: | | ; | ; | | \; | \; | | < | < | | \< | \< | | = | = | | \= | \= | | > | > | | \> | \> | | ? | ? | | \? | \? | | @ | @ | | \@ | \@ | | _ | _ | | \_ | \_ | | ` | ` | | \` | \` | •------•--------• •--------•--------• Remark : If a single BACK-TICK character must be inserted in a CODE SPAN zone, use the following THREE-lines syntax : •------•--------* •--------•--------* | Type | To get | | Type | To get | •------•--------* •--------•--------* | **`` | | | **`` | | | ` | ` | | \` | \` | | ``** | | | ``** | | •------•--------• •--------•--------•

    Best Regards,

    guy038

  • Large File Tab Close

    2
    0 Votes
    2 Posts
    2k Views
    EkopalypseE

    @Brett-Horsley

    depending on your installation/configuration you will have
    either an %APPDATA%\notepad++\backup directory or a
    backup directory in the install directory of npp.
    Rename the file with 100MB. Start Npp.

  • RegEx selective replace

    3
    0 Votes
    3 Posts
    300 Views
    Forum BlokeF

    @PeterJones said in RegEx selective replace:

    (?-s)(DRAW.*)Thirty

    Many thanks!

  • How do I add text to each line?

    6
    0 Votes
    6 Posts
    464 Views
    guy038G

    Hi, @melad-eissa,

    In my previous post, I give an example of the modifications needed :

    INITIAL : sissleib6930 @ stu.howardcollege.edu : Not-Engaged EXPECTED : sissleib6930 @ stu.howardcollege.edu : Not-Engaged :Email. stu.howardcollege.edu

    Seemingly, we need the part between the @ and the : chars because this part has to be re- written at the end of line, too

    However, the part before the @ char does not change at all. So we can represent the goal as below ( note that Space chars are irrelevant )

    The OVERALL match = $0 /¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\ INITIAL Text @ stu.howardcollege.edu : Not-Engaged EXPECTED Text @ stu.howardcollege.edu : Not-Engaged :Email. stu.howardcollege.edu \___________________/ \_____/ \___________________/ Group 1 String Repeated Group 1 SEARCH regex @ ( .+ ) : .+ REPLACEMENT regex $0 :Email. \1

    Now, the exact syntax of this regex S/R is rather obvious :

    SEARCH (?-s)@(.+):.+

    REPLACE $0:Email.\1

    And will change the initial text :

    ernestobaltar@yahoo.com:Golden-Ball amaury.tenaille@epfedu.fr:SilverBall Inspirit@staplesnet.us:Copper_Ball Matthewsk@mail.montclair.edu:Encourage sissleib6930@stu.howardcollege.edu:Not-Engaged

    into the expected text :

    ernestobaltar@yahoo.com:Golden-Ball:Email.yahoo.com amaury.tenaille@epfedu.fr:SilverBall:Email.epfedu.fr Inspirit@staplesnet.us:Copper_Ball:Email.staplesnet.us Matthewsk@mail.montclair.edu:Encourage:Email.mail.montclair.edu sissleib6930@stu.howardcollege.edu:Not-Engaged:Email.stu.howardcollege.edu

    Notes :

    In the search regex :

    First, the (?-s) ensures that any regex symbol . will match a single standard character, only and not EOL chars

    Then the part @(.+): searches for the @ character followed with a non-null range of chars till a colon :. Note that this range is stored as group 1 because of the parentheses

    The final part .+ represents the characters after the colon char of each line

    In the replacement regex :

    We first insert the overall pattern $0. So, everything between the @ char and the end of current line

    Then, we write the literal string :Email.

    -Finally, we re- write the contents of Group 1, so the name of each site, thanks to the \1 syntax

    Best Regards,

    guy038

  • Bullet point and Multi-Asterisk not working as delimiters

    7
    0 Votes
    7 Posts
    659 Views
    phenomenal11P

    @PeterJones
    Well i raised a request on github page. I hope it gets some interest from the dev.

  • Customize search result format

    2
    0 Votes
    2 Posts
    164 Views
    EkopalypseE

    @Easter-Solve

    Can I customizing the format result of the “Search”?

    As a configuration option? Nope.

    But what exactly want you to change maybe there is a workaround for that?

  • Setup to run unitTestLauncher.ps1

    6
    1 Votes
    6 Posts
    311 Views
    el-coder-sbE

    @Ekopalypse Thanks for your help and motivating me to go some steps further!

    I got it:

    I changed my setup to:

    C:\notepad-plus-plus-master <- where I copied the current Notepad++ clone
    C:\npp_7_8_8_bin_x64 <- where the latest realese was unzipped

    This makes it possible to put the path in unitTestLauncher.ps1 without quotation marks (your proposal did not work as this was what caused the “unexpected token”-error), as there is no space in the path (due to Windows “Program Files” -> bad Microsoft!).

    Now my first line in unitTestLauncher.ps1 is:

    C:\npp_7_8_8_bin_x64\notepad++.exe -export=functionList -lasm .\asm\unitTest | Out-Null

    BTW: I get onlly 2x “OK” as the bash test fails. But that´s another story.

    Now I can go on with the VHDL unittest! Thanks for your help!

  • Replace A if B=C

    4
    0 Votes
    4 Posts
    229 Views
    JaevwynJ

    @guy038 said in Replace A if B=C:

    Hi, @jaevwyn and All,

    If I correctly understood you, you want that the value of the TillNumber attribute is changed by the number 91 ONLY IF the value of the StartDate attribute is prior to the date 2020-04-01

    If so, the following regex S/R should work :

    SEARCH \d+(?=</TillNumber>\R.+\R<StartDate>(19\d\d|20[01]\d|2020\-0[123]))

    REPLACE 91

    Of course, select the Regular expression search mode and, may be, the Wrap around option

    Best Regards,

    guy038

    Perfect, thanks!