powershell - Get the int at the end in a string using power shell -


tom1jerry02 --> 02, abcd0asdf001 --> 001, qwerty1 --> 1 

i new powershell , wanted know: how can extract integers @ end of string above sample using power shell?

edit:

these 3 separate strings tom1jerry02, abcd0asdf001 , qwerty1. need solution suitable kind of strings

with powershell you're find many different ways same thing. here's way one-liner:

ps> 'tom1jerry02','abcd0asdf001','qwerty1' | foreach {if ($_ -match '(\d+)$') {$matches[1]}} 02 001 1 

Comments

Popular posts from this blog

matlab - How to equate a structure array to structure array -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -