Searching files with regex will come in handy provided you
know the pattern you want to look for.
Searching for files that you don't have any clue or idea
which one to find is such a dreadful situation.
Regex will help to filter files base on the pattern set from
a fragmented memory due to multi-tasking world.
For example, you are quite sure that the file you're looking
for starts with s and followed by letter k.
So files like skype_password.txt, skew animation.mp4,
skbanner.logo, skin.css, skilled-listing.docx or any files that begins with
"sk" will be filtered.
Here's the PowerShell code to do it:
$regx_filters = get-childitem
"c:\all_files_n_rumble\" -recurse | where-object {$_.name -match
'^s[k]' }
Write-Output $regx_filters
To get folder or directory names with regex:
$regexPattern ="^l[i]"
Get-ChildItem -Path "c:\all_folder_n_mixes\"
-Recurse | Where-Object {$_.PSIsContainer
-eq $true -and $_.BaseName -match $regexPattern }
This will match folder names beginning with "l"
and next letter is "i", folder names like Linux, Linkedin, Linkage,
libro, link folders, live songs, live site folders or basically any folders
beginning with "li" as their folder names.
Just replace the regex pattern to find the files you're searching for.
Cheers! Till next time.
================================
Free Android Apps:
Click on links below to find out more:
Linux Android App cheat sheet:
Multiplication Table for early learners
Catholic Rosary Guide for Android:
Divine Mercy Chaplet Guide (A Powerful prayer):
Comments
Post a Comment