• Finding and deleting a series of lines

    15
    0 Votes
    15 Posts
    5k Views
    Alan KilbornA

    @guy038

    Actually, what you’ve specified is for finding some… , not deleting some…

    To delete, we need to specify:

    SEARCH (as above) REPLACE leave this field blank

    :-)

  • file:///folder opens CMD instead of explorer

    8
    0 Votes
    8 Posts
    725 Views
    tho-gruT

    Hello everyone,

    One solution to my problem is to replace all occurrences of open with command-exec in the registry file:

    Windows Registry Editor Version 5.00 ; Command Prompt [HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\shell\XxX-01MenuCmd] "MUIVerb"="@shell32.dll,-22022" "Icon"="cmd.exe" "ExtendedSubCommandsKey"="Directory\\ContextMenus\\XxX-MenuCmd" [HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\background\shell\XxX-01MenuCmd] "MUIVerb"="@shell32.dll,-22022" "Icon"="cmd.exe" "ExtendedSubCommandsKey"="Directory\\ContextMenus\\XxX-MenuCmd" [HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\ContextMenus\XxX-MenuCmd\shell\command-exec] "MUIVerb"="@shell32.dll,-8506" "Icon"="cmd.exe" [HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\ContextMenus\XxX-MenuCmd\shell\command-exec\command] @="cmd.exe /s /k pushd \"%V\"" [HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\ContextMenus\XxX-MenuCmd\shell\runas] "MUIVerb"="@shell32.dll,-37444" "Icon"="cmd.exe" "HasLUAShield"="" [HKEY_CURRENT_USER\SOFTWARE\Classes\Directory\ContextMenus\XxX-MenuCmd\shell\runas\command] @="cmd.exe /s /k pushd \"%V\""

    Now I have the enhanced context menu at the folder and a double click on file:///c:\tmp starts the windows file explorer.

    Remark: The items in the submenu are displayed by the lexical order (1. command-exec, 2. runas …).

    Thanks for you help.

    Kind Regards
    Thomas

  • Find line before specific text

    2
    0 Votes
    2 Posts
    412 Views
    guy038G

    Hello, @elise-baribault and All,

    Not difficult with regular expressions !

    Open the Mark dialog ( Ctrl+ M )

    SEARCH (?-si)^EL[:;]\x20\K\d+(?=\R.+\RABNORMAL PROGRAM STOP$)

    Tick the three options Bookmark line, Purge for each search and Wrap around

    Un-tick all other box options

    Select the Regular expression search mode

    Click on the Mark All button

    Click on the Copy Marked Text button

    Open a new tab ( Ctrl + N )

    Paste the clipboard contents ( Ctrl + V )

    Et voilà !

    After clicking on the Mark All button you may, either :

    Right-click into the bookmark margin and choose the Copy bookmarked Lines option

    Use the menu option Search > Bookmark > Copy Bookmarked Lines

    Best Regards

    guy038

  • User Extensions for Language Recognition not working for custom styles

    7
    0 Votes
    7 Posts
    425 Views
    Tobias GebhardT

    Ok, I checked with the original Obsidian.xml and it works now.
    Although the Lua block is the same, this strange behavior still exists. (They are only differences in other languages or maybe because of Global Style).
    If anyone wants to further investigate, I would upload the files here, but I can’t.

    Anyway, thank you for the help.

  • Declare and Underscor Multiple Variables

    7
    0 Votes
    7 Posts
    332 Views
    guy038G

    Hello, @Nathan-heath, @peterjones, @alan-kilborn, @astrosofista and All,

    Here is my contribution, which merge the two regex S/R in one S/R only :

    SEARCH (?-i)^(?!Double|$)|^Double\h

    Replace Double_

    So, from your example :

    Double Infuse with Vitality; Double Inkling Summoning; Double Kasmina Enigma Sage;//Kasmina comma Double Killian Ink Duelist;//Killian comma Double Lorehold Apprentice; Double Lorehold Command; Double Lorehold Excavation; Double Lorehold Pledgemage; Double Maelstrom Muse; Double Magma Opus; Double Make Your Mark; Double Manifestation Sage; Double Moldering Karok; Double Mortality Spear; Double Needlethorn Drake; Double Oggyar Battle-Seer; Double Owlin Shieldmage; Double Pest Summoning; Double Practical Research; Prismari Apprentice; Prismari Command; Prismari Pledgemage; Quandrix Apprentice; Quandrix Command; Quandrix Cultivator; Quandrix Pledgemage; Quintorius Field Historian; Radiant Scrollwielder; Reconstruct History; Relic Sloth; Returned Pastcaller; Rip Apart; Rise of Extus; Rootha Mercurial Artist; Rushed Rebirth; Shadewing Laureate; Shadrix Silverquill; Silverquill Apprentice; Silverquill Command; Silverquill Pledgemage; Silverquill Silencer; Spectacle Mage; Spirit Summoning; Spiteful Squad; Square Up; Stonebound Mentor; Tanazir Quandrix; Teach by Example; Tend the Pests; Thrilling Discovery; Vanishing Verse; Velomachus Lorehold; Venerable Warsinger; Witherbloom Apprentice; Witherbloom Command; Witherbloom Pledgemage;

    You should get the expected output :

    Double_Magma Opus; Double_Make Your Mark; Double_Manifestation Sage; Double_Moldering Karok; Double_Mortality Spear; Double_Needlethorn Drake; Double_Oggyar Battle-Seer; Double_Owlin Shieldmage; Double_Pest Summoning; Double_Practical Research; Double_Prismari Apprentice; Double_Prismari Command; Double_Prismari Pledgemage; Double_Quandrix Apprentice; Double_Quandrix Command; Double_Quandrix Cultivator; Double_Quandrix Pledgemage; Double_Quintorius Field Historian; Double_Radiant Scrollwielder; Double_Reconstruct History; Double_Relic Sloth; Double_Returned Pastcaller; Double_Rip Apart; Double_Rise of Extus; Double_Rootha Mercurial Artist; Double_Rushed Rebirth; Double_Shadewing Laureate; Double_Shadrix Silverquill; Double_Silverquill Apprentice; Double_Silverquill Command; Double_Silverquill Pledgemage; Double_Silverquill Silencer; Double_Spectacle Mage; Double_Spirit Summoning; Double_Spiteful Squad; Double_Square Up; Double_Stonebound Mentor; Double_Tanazir Quandrix; Double_Teach by Example; Double_Tend the Pests; Double_Thrilling Discovery; Double_Vanishing Verse; Double_Velomachus Lorehold; Double_Venerable Warsinger; Double_Witherbloom Apprentice; Double_Witherbloom Command; Double_Witherbloom Pledgemage;

    In addition, if you re-run this regex S/R, nothing else is matched and replaced. Nice, isn’t it ?

    Best Regards,

    guy038

  • Difficulty with using backreferences/capture groups in find/replace.

    5
    0 Votes
    5 Posts
    324 Views
    guy038G

    Hello, @james-norton, @alan-kilborn, @terry-r and All,

    BTW, note that there’s an important difference between :

    To search for IPV4 addresses, in a file containing valid IVP4 addresses, only

    To search for valid IPV4 addresses, in a file which may contain some non valid IPV4 addresses !

    In the first case, as the @terry-r’s solution, simply use the almost obvious regex \b(\d{1,3}\.){3}\d{1,3}\b

    In the second cas, use one of the two regexes, below :

    (25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(*FAIL)|\b((?1)\.){3}(?1)\b

    (?(DEFINE)(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))\b((?1)\.){3}(?1)\b

    Notes :

    In the first regex, once the part (25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d) is stored as group 1, the (*FAIL) control verb discards this match but this regex part can be re-used with the syntax (?1). Then, the second alternative \b((?1)\.){3}(?1)\b does match a valid IPV4 address !

    The second regex uses a special conditional syntax with the key expression (DEFINE). which stores, as above, the part 25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d, between parentheses, but which is never matched, by definition. So the effective regex is just the part \b((?1)\.){3}(?1)\b, coming next, which match valid IPV4 addresses only

    Best Regards,

    guy038

  • Find files with multiple Strings

    5
    0 Votes
    5 Posts
    2k Views
    PeterJonesP

    All,

    See also my in-development expressions for generic logic “gates” in regular expressions: AND, OR, XOR, NOR, NAND

    Some day, they might get a blog post all of their own, rather than be buried in that thread. But they are still in-development, so they’ll stay there for now.

  • run JavaScript on Noepad++ file

    3
    0 Votes
    3 Posts
    3k Views
    JRJ

    @PeterJones lol! great repsonse. ill look into the jN plugin

  • regex replace syntax

    2
    0 Votes
    2 Posts
    167 Views
    Terry RT

    @I-neuw said in regex replace syntax:

    What am I missing?

    Well, it could be anything, as we don’t know what P++ is, maybe you meant to say NPP or Notepad++.
    A regex I’d use would be
    Find What:\x20
    Replace With:\n

    But then be aware that a \n is not normal for a windows text file. Windows uses \r and \n normally. Unix and Mac use one of them each (different ones).

    Possibly showing a bit more detail and examples if possible of what you saw when trying to do the replacement might help us to understand what could have gone wrong.

    Terry

  • What is going on with this user defined language?

    14
    0 Votes
    14 Posts
    1k Views
    Ksomeone Msomeone 0K

    @PeterJones said in What is going on with this user defined language?:

    @Ksomeone-Msomeone-0 said in What is going on with this user defined language?:

    I’ll try to get around to bug reporting this.

    It looks like someone did report this as issue#10007 – given the example screenshot, I’m assuming it’s the same person, despite the different username.

    That’s mine, yes.

  • regex specific char change by anther without change the found sentence

    2
    0 Votes
    2 Posts
    168 Views
    PeterJonesP

    @Kirill-Nudelman ,

    Doesn’t a normal Search > Replace, Find What = ., Replace with = _, Search Mode = Normal do that? It does for me.

  • YAML extension, Search 2 Value and Replace

    10
    0 Votes
    10 Posts
    907 Views
    Mark LozadaM

    @PeterJones
    I have my final search string, thanks to you sir! In order for the search to distinguish if it’s missing the “Slots” entry, I have to searched from "Range: to “Job:”

    Search:
    (Range: \d)+(\s*)(?!Slots: \d+)(\s*)Jobs:$
    Replace:
    \1 \r\n\tSlots: 4 \r\n\tJobs:

  • Regex: Select all between double quotes ""

    3
    0 Votes
    3 Posts
    448 Views
    Robin CruiseR

    thanks @guy038

  • Question About Formatting

    4
    0 Votes
    4 Posts
    372 Views
    Alexander Elan ConstantinoA

    @Terry-R said in Question About Formatting:

    For getting an exact copy use the windows explorer function to make a copy which will be a clone. However since it appears you are trying to alter settings so your app will be customised to your needs, using Notepad++ to perform edits on this file will very likely end in abject failure.

    Okay, that makes sense! Thank you for the information about binary files!

  • function list questions

    3
  • how do i delete the whole line based on a find argument

    3
    0 Votes
    3 Posts
    6k Views
    dinkumoilD

    @Ben-Robertshawe

    There is also a solution without using regular expression searches.

    Open the Find dialog box and navigate to register Mark. Enter your search tag in Find what. Tick option Bookmark line. You may also tick options Purge for each search and Wrap around. Furthermore tick option Normal in Search mode group box. Click on button Mark All. Navigate to (menu) Search -> Bookmark and click on submenu entry Remove Bookmarked Lines.
  • 0 Votes
    11 Posts
    470 Views
    Robin CruiseR

    I found a solution that works with PowerShell, that will replace all lines with the canonical link tag:

    $sourcedir = "C:\Folder1\" $resultsdir = "C:\Folder1\" Get-ChildItem -Path $sourcedir -Filter *.html | ForEach-Object { $content = Get-Content -Path $_.FullName -Raw $replaceValue = (Select-String -InputObject $content -Pattern '(?<=<link rel="canonical" href=").+(?=" />)').Matches.Value $content = $content -replace 'https:\/\/.+.html',$replaceValue Set-Content -Path $resultsdir\$($_.name) $content }
  • How do I Replace all at end of Line?

    3
    0 Votes
    3 Posts
    370 Views
    Nathan HeathN

    @PeterJones Thank you, it worked perfectly.

  • Plugin Admin not installing any plugins

    3
    0 Votes
    3 Posts
    5k Views
    jnappo64J

    go to proxy configuration and delete 0.0.0.0

  • Flickering when changing tabs

    3
    0 Votes
    3 Posts
    537 Views
    T

    Debug info:
    Notepad++ v8 (64-bit)
    Build time : Jun 6 2021 - 18:38:25
    Path : C:\Program Files\Notepad++\notepad++.exe
    Command Line :
    Admin mode : OFF
    Local Conf mode : OFF
    Cloud Config : OFF
    OS Name : Windows 10 Home (64-bit)
    OS Version : 2004
    OS Build : 19041.1052
    Current ANSI codepage : 1252
    Plugins : mimeTools.dll NppConverter.dll NppExport.dll RunMe.dll VisualStudioLineCopy.dll

    Although it also occurs when I use a fresh portable version. The files are relatively small XML files. It is especially visible in the document map. It only occurs when the »Word wrap« option is enabled, but then also on another (powerful) PC.