powershell - Find multiple keywords in a sentence -
i trying search multiple keywords in rather large text document example: need search if regional , new york show in 1 sentence. current script have provides me 1 or other not both.
my current script is:
get-content <file name>.txt | select-string '(phrase)'
any thoughts?
here how results multiple patterns:
get-content "yourtextfile.txt" | select-string -pattern '(regional.*new york)|(new york.*regional)'
essentially, looks 2 phrases occur in same line in either order.
Comments
Post a Comment