Hi,
If you want to match the digits following VL, you could use zero-width positive lookbehind assertions and the regex could be (?<=VL)\d{2,3}
$nics = Import-Csv C:\nics.csv
$Vlan = foreach($nic in $nics){
if($nic.YourColumnName -match "(?<=VL)\d{2,3}"){$matches.Values}
}
Best Regards,
Ian
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.