Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $DSprod = Read-Host 'DSPROD?'
- $regexA = '([\w]+)'
- $regexC = '(["\w])'
- $regexD = '([\s-_:,]+)'
- $regexResB = '$&+'
- $regexResA = '[$&]+'
- $regexResC = '[\s-_:,]+'
- $c = $DSprod -replace $regexC, $regexResB
- $c = $c -replace $regexD, $regexResA
- $d = ''
- $appo = $DSprod -split ' '
- Foreach ($w in $appo)
- {
- $w = $w.ToCharArray() | select -uniq
- $w = -join $w
- $d = $d+ $w + " "
- }
- $d = $d.Trim() -replace $regexA, $regexResA
- $d = $d -replace $regexD, $regexResC
- Write-Host "Regexp1: " $c
- Write-Host "Regexp2: " $d
Add Comment
Please, Sign In to add comment