abg
abg

Reputation: 361

PowerShell - Substring regex

I need to search a file for any string that contains the sub-strings "ME" and "SW", in this order, with any character (even non-alphanumerical), before, between and after them.

So far this line works for me:

*select-string -path "..path" -pattern ME*

But, when I try the regex [.]*ME[.]*SW[.]* it returns null.

Also, when using [.]*ME[.]* it works.

Upvotes: 1

Views: 151

Answers (1)

David Cros Piezzoli
David Cros Piezzoli

Reputation: 305

You should try this....

ME.*SW

Upvotes: 4

Related Questions