I am trying to extract from some notes, words that ends in .story. This words are always placed into some links such as bla:///bla/bla/bla/.../word.story
. The notes may contain multiple links and the format of these notes may vary but there I will always have entries in form of bla///../..../bla.story
.
Until now I've used the following expression: [string]$story_name = Select-String \w+..story -input $notes -AllMatches | Foreach {$_.matches -replace ('\.story','')}
but now I'm facing some issues with this because it seems that if the link contains entries as bla:///bla/blablaistory/bla/bla/word.story
than this expression will also select that word that contains 'istory' and I do not want this to happen. What I should use in order to avoid this?