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

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -