“Powershell Regex” Respostas de código

Powershell agarra Regex

# Grab regex group in powershell (e.g. version from string)
$STR="v0.1.1-prerelease-2"
$VERSION=[regex]::match($STR,'(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)').Groups[0].Value
# $VERSION will print 0.1.1
Muddy Moose

Powershell Regex

\d digit [0-9]
\w alpha numeric [a-zA-Z0-9_]
\s whitespace character
.  any character except newline
() sub-expression
\  escape the next character
HandsomeOldGod5355

Respostas semelhantes a “Powershell Regex”

Perguntas semelhantes a “Powershell Regex”

Procure respostas de código populares por idioma

Procurar outros idiomas de código