I have a simple REGEX method to obtain the last alphabetic characters of a string by removing letters and numbers which precede it:
"TEST02TEST" | %{($_ -Replace '\D*\d*(\w*)', '$1')}
the output for this is obviously TEST
What if I want to select it at the end of a pipeline? What do I call it, what is it's object name?
Basically I am trying to use add-member get both the refined string and the original string like this:
"TEST02TEST" | %{($_ -Replace '\D*\d*(\w*)', '$1') | Add-Member -MemberType NoteProperty -Name OriginalString -Value $_ -PassThru} | select OriginalString, (something here)
What is the "something here"?