Skip to content

Instantly share code, notes, and snippets.

@rossnz
Created January 20, 2014 13:29
Show Gist options
  • Save rossnz/8519834 to your computer and use it in GitHub Desktop.
Save rossnz/8519834 to your computer and use it in GitHub Desktop.
String replace - only keep digits
$myString = "99 Bottles of beer on the wall!"
$myValue = $myString -replace '[ !,.a-zA-Z]'
Write-Host $myValue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment