I am trying to extract just the tomcat version from the command in a perl script and ran in to issue with the regex part. Any help would be greatly appreciated. Here's my code:
if($tomcat_ver=~ m/Server number: (.+)[0-9]$/s)
This regex would also do:
m/Server number: (.+)\n/)
It will match till the new line character is encountered. And to save it assign $1(predefined variable) to a custom variable where you want to store the version info.