I'm using a regex in a txt using powershell, but it's work only if the text doesn't contain carriage return. I prepared an example file like this:
the duck is on the table --found!
the elephant is on the table --found!
the cat is
on the table --NOT found! :-(
the lion is on the tablet --NOT found but ok ;-)
the dog is on
the table --NOT found! :-(
the turtle isonthe table --NOT found but ok ;-)
the cow is on the table --found!
I want cases with contain "on the table", so I execute this:
select-string -path "c:\example.txt" -pattern '([^\w]{1})on([^\w])+the([^\w])+table([^\w]{1})'
This is the output :
example.txt:1:the duck is on the table --found!
example.txt:2:the elephant is on the table --found!
example.txt:14:the cow is on the table --found!
But i need also the cases with carriage return! Where is the cat? And where is the dog?
Thank you ;-)