Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
I know this may seem simple but i am trying to parse a string "NP Softwarename.4.8.9.msi. I am trying to just get the numbers but keep the periods so it will look like this "4.8.9". Below is what i have so far. I just need to get rid of the period in the front of the numbers.
When i run your line it just says true. If i do a replace it gives everything except the numbers. Not to good at regex so i don't understand whats going on. Will try to read but how do i just get "4.8.9"
Ok after messing around with regex I wrote this /(\d+)\.(?:(\d+)\.(\d+))?(?:\-(\w+))?/i. it works for the below in regex but i cant seem to get it to work in powershell. It takes only the numbers and not the leading and trailing periods.
This topic is 7 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.