Guest User

Untitled

a guest
Dec 12th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. $DSprod = Read-Host 'DSPROD?'
  2.  
  3. $regexA = '([\w]+)'
  4. $regexC = '(["\w])'
  5. $regexD = '([\s-_:,]+)'
  6.  
  7. $regexResB = '$&+'
  8. $regexResA = '[$&]+'
  9. $regexResC = '[\s-_:,]+'
  10.  
  11. $c = $DSprod -replace $regexC, $regexResB
  12. $c = $c -replace $regexD, $regexResA
  13.  
  14. $d = ''
  15. $appo = $DSprod -split ' '
  16. Foreach ($w in $appo)
  17. {
  18. $w = $w.ToCharArray() | select -uniq
  19. $w = -join $w
  20. $d = $d+ $w + " "
  21. }
  22.  
  23. $d = $d.Trim() -replace $regexA, $regexResA
  24. $d = $d -replace $regexD, $regexResC
  25.  
  26. Write-Host "Regexp1: " $c
  27. Write-Host "Regexp2: " $d
Add Comment
Please, Sign In to add comment