RegEx Windows Search

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

  1. Duckz

    Duckz MDL Novice

    Jan 6, 2010
    43
    5
    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 Novice

    Jan 6, 2010
    43
    5
    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

    Jul 23, 2008
    5,865
    1,765
    180
    As will do FileLocator Lite
     
  4. GodHand

    GodHand MDL Senior Member

    Jul 15, 2016
    315
    279
    10
    Get-ChildItem -Path "E:\TV Shows" -Recurse | ? { $_.Name -match "^S[0-9]+E[0-9]+-E[0-9]+$" }