Hello,
I trying to find a pattern in files, but i when i get a match using select-string, i don't want the entire line, i just want the part that matched. Is there a parameter i can specify to do this?
Ex:
If i did
select-string .-.-.
and the file contained a line with: abc 1-2-3 abc
I'd like to get a result of just "1-2-3" instead of the entire line getting returned.
I believe in unix what i want is grep -o, but i haven't found an equivalent in powershell and googling anything with a dash doesn't work well.
Does anyone know a good method of getting this result?