RosettaCodeData/Task/Multisplit/PowerShell/multisplit.ps1

12 lines
375 B
PowerShell
Raw Permalink Normal View History

2026-04-30 12:34:36 -04:00
$string = "a!===b=!=c"
$separators = [regex]"(==|!=|=)"
$matchInfo = $separators.Matches($string) |
Select-Object -Property Index, Value |
Group-Object -Property Value |
Select-Object -Property @{Name="Separator"; Expression={$_.Name}},
Count,
@{Name="Position" ; Expression={$_.Group.Index}}
$matchInfo