I'm trying to replace the -r in this Semantic version 2020.7.28-r5 with a single period, but I'm getting this instead 2020.7.28..
Here's what I've come up with so far:
"2020.7.28-r5" -replace "(-[A-Za-z-][0-9A-Za-z-]*)", "."
A specification:
rwill always be one or more characters (in this case simplyr)rcan be any SemVer-legal character ([0-9A-Za-z-])rwill always end in a character, never a digitrwill always be preceded by a hyphen-- The final number (the build number for the day) will always be one or more digits
Based on this answer I tried this expression:
"(-[A-Za-z-][0-9A-Za-z-]*)(?=\d{4})"
But it didn't replace anything.
How can I start with 2020.7.28-The11thFantasticallyCleverUpdateForTheDay11 and end up with 2020.7.28.11?