I need to extract a specific information from the text messages below. It is “22.214.171.124.3” which is next to “Version”.
I think if I use ‘awk’ or ‘Regex’, I could get it but I was wondering if there is another simple way by handling text strings.
Do you have an idea?
software Command Interpreter
Version 126.96.36.199.3 Linux 0_PLATFORMS_231312.1925.2_FBO
Linux, x64, 64bit (optimized), first on Nov 11 2015 01:38:14
Operating system character set identified as UTF-8.
The version number will be in sub expression 1
Input strings have 4 lines so I need to handle more if I use Split.
I think I should take RegEx approach. It works !!
Dim rg as New RegEx
Dim myMatch as RegExMatch
inputString = BufferString
rg.SearchPattern = "Version\\s([0-9\\.]*)\\s"
If myMatch<>nil Then
Using Tim’s suggestion as a starting point, I came up with this:
Since this uses a positive lookbehind to confirm the leading string, the entire match will be the version number (no subexpressions).
This is meant as informative only, since there is no real reason to change it.