질문 : PowerShell 정규식 패턴은 Bash의 문자열 명령과 같은 출력을 반환합니까?PowerShell에서 GC로 바이너리 정규식
gc 및 Select-String : Episode # 137 : Free-base64-ing에 대한 기사를 찾았습니다. http://blog.commandlinekungfu.com/2011/03/episode-137-free-base64-ing.html
이전 질문에서 정규식 패턴을 여러 번 시도했습니다. 영숫자 및 밑줄의 정규식. Regular Expression for alphanumeric and underscores
내가 Bash에서 실행하는 경우 : strings --all myfile.bin 결과 : 52939 줄의 문자열입니다.
gc. \ myfile.bin | Select-String -AllMatches "^ [a-zA-Z0-9 _] * $" 결과 : 여러 개의 빈 줄이 나타납니다.
gc. \ myfile.bin | Select-String -AllMatches "^ \ w * $" 결과 : 9 줄의 문자와 여러 개의 빈 줄.
gc. \ myfile.bin | Select-String -AllMatches "^ \ w * $" 결과 : 9 줄의 문자.
gc. \ myfile.bin | Select-String -AllMatches "[A-Za-z0-9_]" 결과 : 거의 모든 파일, 인쇄 할 수없는 문자 및 모두.
gc. \ myfile.bin | Select-String -AllMatches "^ [\ p {L}} \ p {Nd} _] + $" 결과 : 20 줄의 문자.
그래서 내가 누락 된 정규식 트릭은 무엇입니까?
Regex 부분이 intersting 비트입니까? [strings] (http://www.mkssoftware.com/docs/man1/strings.1.asp)과 같이 많은 작업을 수행하고 있습니다. – Guvante