RegEx Windows Search

Discussion in 'Scripting' started by Duckz, Jan 14, 2018.

  1. Duckz

    Duckz MDL Junior Member

    Joined:
    Jan 6, 2010
    Messages:
    51
    Likes Received:
    10
    Trophy Points:
    0
    Hi all,

    I'm trying to perform a search of a directory and all of it's sub directories, for any files that contain a common string of characters. I've performed this search in the past, but I cannot remember how I did it.

    I've been playing a bit in PowerShell, but I have no real knowledge of it, so I'm not too sure if I am even close.

    Here is what I've got at the moment;
    Code:
    Get-ChildItem -Path "E:\TV Shows" -Recurse | Where-Object { $_.name -match '\S[0-9]+E[0-9]+-E[0-9]+\' }
    Basically, I want a list of files that contain in it's filename SxxExx-Exx (where xx is replaced by two numbers).

    Am I on the right track?

    Any help would be gratefully appreciated.

    Thanks.
     
  2. Duckz

    Duckz MDL Junior Member

    Joined:
    Jan 6, 2010
    Messages:
    51
    Likes Received:
    10
    Trophy Points:
    0
    Solved.

    Found that it was a piece of software I used in the past called UltraSearch.

    Performed the exact search I was wanting to do with the above RegEx.
     
  3. sebus

    sebus MDL Guru

    Joined:
    Jul 23, 2008
    Messages:
    6,201
    Likes Received:
    1,945
    Trophy Points:
    210
    As will do FileLocator Lite
     
  4. GodHand

    GodHand MDL Addicted

    Joined:
    Jul 15, 2016
    Messages:
    534
    Likes Received:
    880
    Trophy Points:
    30
    Get-ChildItem -Path "E:\TV Shows" -Recurse | ? { $_.Name -match "^S[0-9]+E[0-9]+-E[0-9]+$" }