Author Posts

August 30, 2016 at 10:54 am

Hi Using PowerSHell 5

I'm trying to pick out 'kb3114938' -type hotfixes from filenames (soifjokb3114938j44idsi) and texts. So the "kb" stays the same while the 7 numbers change depending on what hotfix im searching for. So basically i want to pick up every 'kb'+ 7 following numbers.
Any Regual Expression experts out there?



August 30, 2016 at 11:25 am

Hi Bjørn,

Please check if below works for you.

$text = 'soifjokb3114938j44idsi'
if ($text -match 'kb\d{7}') {
    $kbNumber = $Matches[0]
  • This reply was modified 2 years, 1 month ago by  Daniel Krebs.

August 30, 2016 at 11:37 am

Hi Daniel

Wow great, works nicely!
Thank you very much!