Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "-----start-------Hello World------end-------"
- Hello World
- PS C:> $x = "----start----Hello World----end----"
- PS C:> $x -match "----start----(?<content>.*)----end----"
- True
- PS C:> $matches['content']
- Hello World
- PS > "test_string".Substring(0,4)
- Test
- PS > "test_string".Substring(4)
- _stringPS >
- $s = 'Hello World is in here Hello World!'
- $p = 'Hello World'
- $s -match $p
- dir -rec -filter *.txt | Select-String 'Hello World'
- $String="----start----`nHello World`n----end----"
- $SearchStart="----start----`n" #Will not be included in results
- $SearchEnd="`n----end----" #Will not be included in results
- $String -match "(?s)$SearchStart(?<content>.*)$SearchEnd"
- $result=$matches['content']
- $result
- $String=[string]::join("`n", (Get-Content $Filename))
- $line = "----start----Hello World----end----"
- $line -match "Hello World"
- $matches[0]
- Hello World
- $result = $matches[0]
- $result
- Hello World
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement