Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

powershell grab 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
Comment

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
Comment

PREVIOUS NEXT
Code Example
Shell :: how to install .deb file in ubuntu from terminal 
Shell :: git delete remote branch error: unable to delete remote ref does not exist 
Shell :: disable vscode server 
Shell :: show all remote branches git 
Shell :: clear bash command history 
Shell :: show applications shortcut ubuntu move right 
Shell :: uninstall vmware in ubuntu 
Shell :: react router not working in cpanel 
Shell :: change wsl to version 1 
Shell :: how to know what container is using a volume? 
Shell :: snap store android studio 
Shell :: awk print lines when match is found with specific field 
Shell :: bash get file name 
Shell :: how to find process running on port in ubuntu 
Shell :: linux generate csr 
Shell :: kubectl install ubuntu 20.04 
Shell :: install geth in ubuntu 
Shell :: connect git to github 
Shell :: how to stop port 8080 
Shell :: install docker on Amazon Linux 2 AMI 
Shell :: how to install gatsby with typescript 
Shell :: The current branch zuqing_feature2 has no upstream branch. 
Shell :: github track filename capitalisation 
Shell :: size of folder linux 
Shell :: rust install 
Shell :: bash zero padding 
Shell :: change git commit date 
Shell :: see ADS content 
Shell :: ubuntu install blender 
Shell :: flutter upgrade 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =