How about this? {#([^#]+)#}
Here is an example used in a PowerShell script:
$input = "{#Something#} Hello {#Brand#}" $match = [regex]::Match($input, "{#([^#]+)#}") $i = 0 while ($match.Success) { $i++ write-host ("Match {0}: '{1}'" -f $i, $match.Groups[1].Value) $match = $match.NextMatch() }
And here is what he infers:
Match 1: 'Something' Match 2: 'Brand'
source share