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 :: moodle update cli 
Shell :: nginx install ssl certificate centos 
Shell :: setup ssh key 
Shell :: git tag documentation 
Shell :: powershell set environment variable and run command 
Shell :: fix corrupt pdf command line 
Shell :: selinux 
Shell :: virtualbox boot from usb 
Shell :: mv linux command 
:: count file linux 
Shell :: pacman search 
Shell :: ubuntu enable network manager 
Shell :: create rails app 
Shell :: git commit exluding one file 
::  
Shell :: create samba user ubuntu 
:: arch linux wine 
:: open crontab in nano 
Shell :: how add ssh 
Shell :: connection to server at "localhost" (::1), port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections 
Shell :: install windows 10 on virtualbox mac 
Shell :: add gist file to dev.to 
Shell :: How to clean up the git repo and reduce its disk size 
Shell :: temeprature ubuntu command line 
Shell :: dd command to add image to usb 
Shell :: patch a file in vendor 
Shell :: backup pihole settings 
Shell :: docfetcher ubuntu 
:: fatal: malformed object name HEAD 
:: deploy contract on bsc testnet hardhat 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =