I'm currently looking for a way to count equal regex matches and output them in a table or something similar.
My regex looks like this:
$regex = "\A[[]{1}[0-9]{2}[.]{1}[0-9]{2}[.]{1}[0-9]{2}[,]{1}\s[0-9]{2}[:]{1}"
My Powershell code looks like this at the moment and outputs just all the matches the script finds.
((Select-String $content -Pattern $regex -AllMatches).Matches).value
The output the script gives me looks like this (shortened):
[02.12.21, 11:
[02.12.21, 11:
[02.12.21, 11:
[02.12.21, 13:
[02.12.21, 13:
[02.12.21, 13:
[02.12.21, 13:
[02.12.21, 13:
[02.12.21, 13:
[02.12.21, 13:
I would like to output something similar like this:
[02.12.21, 11: (3 times)
[02.12.21, 13: (7 times)
Can someone help me out?
Thanks in advance!