Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 34890

RegEx for Splitting Hairs

$
0
0

Here’s some hairs…

 

ths4tmxkvx

 

Wrong hairs!

 

Here is the intended hairs…


$Hairs = 'PD112345D123456F£45637'

 

How do we split $Hairs down to just show numbers? RegEx and -Split to the rescue.


$Hairs -split "D+"

 

capture189

 

Here we are using anything that isn’t a digit as the divider. Simples.

 


Viewing all articles
Browse latest Browse all 34890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>