Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 8583

Regex Pattern

$
0
0

Hi there

I'm trying to find all instances of the following types in my script below

*Defender_*

*Midfielder_*

 

*Winger_*

How do i add the other 2 patterns as well into the script below and how do i evaluate the above into a regex pattern because ‘\s\SDefender_$’ doesn't work?

 

Please advice

$input_path = ‘C:\log.txt’

$output_file = ‘C:\log_Extracted.txt’

$regex = ‘\s\SDefender_$’

Write-Host $regex

#select-string -Path $input_path -Pattern $regex -AllMatches | % { $_.Matches } | % { $_.Value } > $output_file


Viewing all articles
Browse latest Browse all 8583

Trending Articles