Adds named capture groups as note properties to Select-String’s MatchInfo objects.
Add-CapturesToMatches.ps1 [[-MatchInfo] <MatchInfo>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
.*?\b)\s*(?<Email>\S+@\S+)$' addrbook.txt |Add-CapturesToMatches.ps1 |select Name,Phone,Filename
Name Email Filename —- —– ——– Arthur Dent adent@example.org addrbook.txt Tricia McMillan trillian@example.com addrbook.txt
The MatchInfo output from Select-String to augment with named capture groups.
Type: MatchInfo
Parameter Sets: (All)
Aliases: InputObject
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.