$An_Array = @('somethingno1', 'somethingno2','morestuff') $An_Array | Where-Object {$_ -match 'something'} 'somethingno1' -match 'something' 'somethingno1' -match 'nothing' 'The book is good' -replace 'The book', 'The ITA book' > Get-Service | where {$_.status -like "running"} > Get-Service | where {$_.status -match "running"} . ^ $ [ ] { } * ? + \ > 'something.txt' -match 'i*' > 'Thatistheone.txt' -match 'i*' > 'itssomething.txt' -match '^i' > 'Thatistheone.txt' -match '^i' > 'something.txt' -match 't$' > 'something.txt' -match 't$' True ** > $matches Name ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** Value 0 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** t > $Teststring='Programming' > $Teststring -match "\w" > $Teststring -match "\W" > $Teststring='Programm456ing > $Teststring -match "\d" True ** > $matches Name ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** Value 0 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** 4 > $Teststring -match "\d+" True ** > $matches Name ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** Value 0 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** 456 > $Teststring -match "\d{2}" True ** > $matches Name ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** Value 0 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** 45 > $Teststring -match "\d{2,3}" > $Input= Read-Host "Please enter three digits followed by at least 4 but less than 8 letters!" > $input -match "^\d{3}\w{4,8}$" > $Teststring ='What is it To you, dude?' > $Teststring -match "[wy]" True > $Teststring -match "[p-t]" True ** $matches Name ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** Value 0 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** t > $Teststring='Hello678 again' > $Teststring -match "[^a-z]" True ** > $matches Name ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** Value 0 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** 6 > $Teststring -match "[^a-z]+" variant; the output in the $matches variable is then 678.