"This is **bold** and this is also **BOLD**,finally this is also **Bold**" -match '\*\*.*?\*\*'
Finds only the first match
$Matches.count
Returns only 1
Doing the same thing with -Replace Finds all matches in the string:
"This is **bold** and this is also **BOLD**,finally this is also **Bold**" -replace '\*\*.*?\*\*', 'Substring'
It matches and replaces all instances:
This is Substring and this is also Substring,finally this is also Substring
How do I get the -Match operator to find all matches and return them as arrays belonging to the $Matches variable?
Thanks!