I need to get an application ID from a website where we file applications. You can’t select just that line as an element, it only takes the whole block. So I used screen scrape to get the full text. Now I want to only isolate that Application ID.
The wording might not always be the same, so I can’t use the number as length to trim.
Is there a VB expression that will let me trim all the extra text and leave me only with the x number of characters following “Application ID:” ?
Text example:
What Happened: Completed application was successfully saved and any files chosen have been successfully uploaded.
Application ID: 1321564ABVKA
Date: July 05, 2019
Current Status: Awaiting Payment
Fine
if the input string is saved in a variable of type string like
str_input = “What Happened: Completed application was successfully saved and any files chosen have been successfully uploaded.
Application ID: 1321564ABVKA
Date: July 05, 2019
Current Status: Awaiting Payment”
Then the output would be like this str_output = Split(str_input.Split(Environment.Newline.ToArray())(2).ToString.Trim,“ID:”)(1).ToString.Trim
Your answers seemed to work best. I’m still trying to learn Regex…
I was trying to remove all personal information from the example I gave. That included a name in brackets, which I want to exclude as well. But those brackets seem to mess with the regex.
So it would be something like the below. How can I modify the regex so that it will also exclude “(my name)”?
What Happened: Completed application was successfully saved and any files chosen have been successfully uploaded.
Application ID: 1321564ABVKA (my name)
Date: July 05, 2019
Current Status: Awaiting Payment