1. Gon

    Gon Well-Known Member

    Aug 5, 2014
    423
  2. Tango

    Tango Super Moderator Staff Member

    Jul 9, 2009
    3,333
    Code:
    https://rapidgator.net/file/(.*)\/(.*)
    
    Replace $2
    [​IMG]
     
  3. Gon

    Gon Well-Known Member

    Aug 5, 2014
    423
    thanks for the reply. i have the notepad++ regex code which i posted in my first post. what i am looking for instead of using notepad++, i want to use powershell for the replace.
     
  4. Tango

    Tango Super Moderator Staff Member

    Jul 9, 2009
    3,333
    Powershell would be very similar.

    Code:
     "https://rapidgator.net/file/asdcb6af26/test.rar" -replace "https://rapidgator.net/file/(.*)\/(.*)", '$2'
    [​IMG]
     
  5. Tango

    Tango Super Moderator Staff Member

    Jul 9, 2009
    3,333
    If you want to grab filenames from all lines in file & save to a new file, this will do it, this presumes the existing file is empty.
    [​IMG]

    Code:
    foreach($line in [System.IO.File]::ReadLines("e:\rg.txt")) {$line.split('/')[-1] | Add-Content e:\test.txt}
     
  6. Gon

    Gon Well-Known Member

    Aug 5, 2014
    423
    i solved the issue different way after seeing your code, thanks :D
     
    Last edited: Oct 12, 2019

Share This Page