I need to write a PowerShell script which will remove characters before a digit. Example: input is "...das.as.1.2.3" or "v.1.2.3" output should be: "1.2.3"
have zero experience in powershell scripting
CodePudding user response:
PS C:\> "...das.as.1.2.3" -replace '^\D '
1.2.3
A regular expression to replace anything which is not-a-digit chars, from the beginning of the string.