For the following strings, I am trying to extract ‘mainline’ if the string contains mainline, or the number at the end if it doesnt contain mainline. I am using Java.
Eg, for the following strings I want just the numbers at the end
Solaris10NBngp-bwm1.1.X // want 1.1.x
Solaris10NBbytel2.0.0.0x // want 2.0.0.0x
Solaris10NBbwm1.2.X // want 1.2.X
Solaris10NBoam_bwm1.4.0.X // want 1.4.0X
Solaris10NBoam1.7.X // want 1.7.X
Mainline examples:
Solaris10NBngp-bwm_mainline // want mainline
LinuxNBdaypass_mainline // want mainline
LinuxNBngp_mainline // want mainline
Is this possible using regex, and if so, anybody know how to do it? 🙂
For the above inputs,