Skip to content

Instantly share code, notes, and snippets.

@vexx32
Created January 22, 2020 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vexx32/1260bf8c9c04e42801ab7fb2f9fb5de9 to your computer and use it in GitHub Desktop.
Save vexx32/1260bf8c9c04e42801ab7fb2f9fb5de9 to your computer and use it in GitHub Desktop.
$string = 'hostname.database.table.schema'
if ($string -match '(?<Hostname>\w+)\.(?<Database>\w+)\.(?<Table>\w+)\.(?<Schema>\w+)') {
$matches.Remove(0)
[PSCustomObject]$matches
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment