Created
December 18, 2018 14:19
-
-
Save atao/4b5195b25b4341c4c3cb9aa58380ee51 to your computer and use it in GitHub Desktop.
Regex example in PowerShell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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