I have input stream with the following data:
---------------------------------------------
manil@manil-ubvm:~$ db2level
DB21085I Instance "manil" uses "64" bits and DB2 code release "SQL10010" with
level identifier "0201010E".
Informational tokens are "DB2 v10.1.0.0", "s120403", "LINUXAMD64101", and Fix
Pack "0".
Product is installed at "/home/manil/sqllib".
---------------------------------------------
From above i need v10.1.0.0 to be stored in a string variable.
How to do that using java regular expression?
Use something like this to capture the version pattern :
Output is :
You really need to understand regexes deeply if you are a programmer. They are one of the essentials. They are hard at first, but once you ‘crack them’ you don’t forget it. Like riding a bike.