Created
April 22, 2020 07:16
-
-
Save HumanEquivalentUnit/406d4ddb565b1f1f1f5fd817c0d63eae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$keys = @{ | |
'1'='' ; '2'='[abc]'; '3'='[def]' ; | |
'4'='[ghi]' ; '5'='[jkl]'; '6'='[mno]' ; | |
'7'='[pqrs]'; '8'='[tuv]'; '9'='[wxyz]'; | |
} | |
$nums = '76937' | |
$pattern = foreach ($char in $nums.GetEnumerator()) | |
{ | |
$keys["$char"] | |
} | |
$pattern = "^$($pattern -join '')$" | |
$pattern | |
$words = [IO.File]::ReadAllLines('C:\path\to\wordlist.txt') | |
$words -match $pattern |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment