Skip to content

Instantly share code, notes, and snippets.

@atao
Created December 18, 2018 14:19
Show Gist options
  • Save atao/4b5195b25b4341c4c3cb9aa58380ee51 to your computer and use it in GitHub Desktop.
Save atao/4b5195b25b4341c4c3cb9aa58380ee51 to your computer and use it in GitHub Desktop.
Regex example in PowerShell
$message = '(001945) 12/18/2018 10:50:47 AM - (not logged in) (127.0.0.1)> 530 Login or password incorrect!'
$message -match '(\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)(.*)(incorrect!)'
$Matches[0]
$Matches[1]
$Matches[2]
$Matches[3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment